mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
csfixes
This commit is contained in:
parent
4c704734cd
commit
bb86d04e52
@ -24,12 +24,12 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
{
|
{
|
||||||
protected AuthorizationHelper $authorizationHelper;
|
protected AuthorizationHelper $authorizationHelper;
|
||||||
|
|
||||||
|
protected Security $security;
|
||||||
|
|
||||||
protected TokenStorageInterface $tokenStorage;
|
protected TokenStorageInterface $tokenStorage;
|
||||||
|
|
||||||
protected TranslatorInterface $translator;
|
protected TranslatorInterface $translator;
|
||||||
|
|
||||||
protected Security $security;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
TokenStorageInterface $tokenStorage,
|
TokenStorageInterface $tokenStorage,
|
||||||
AuthorizationHelper $authorizationHelper,
|
AuthorizationHelper $authorizationHelper,
|
||||||
@ -47,7 +47,6 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
$period = $parameters['accompanyingCourse'];
|
$period = $parameters['accompanyingCourse'];
|
||||||
|
|
||||||
if (AccompanyingPeriod::STEP_DRAFT !== $period->getStep()) {
|
if (AccompanyingPeriod::STEP_DRAFT !== $period->getStep()) {
|
||||||
|
|
||||||
if ($this->security->isGranted(AccompanyingPeriodVoter::SEE, $period)) {
|
if ($this->security->isGranted(AccompanyingPeriodVoter::SEE, $period)) {
|
||||||
$menu->addChild($this->translator->trans('Calendar'), [
|
$menu->addChild($this->translator->trans('Calendar'), [
|
||||||
'route' => 'chill_calendar_calendar_list',
|
'route' => 'chill_calendar_calendar_list',
|
||||||
|
@ -25,7 +25,6 @@ class LocationMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderI
|
|||||||
|
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
|
if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,6 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||||||
*/
|
*/
|
||||||
class SectionMenuBuilder implements LocalMenuBuilderInterface
|
class SectionMenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
protected AuthorizationCheckerInterface $authorizationChecker;
|
protected AuthorizationCheckerInterface $authorizationChecker;
|
||||||
|
|
||||||
protected TranslatorInterface $translator;
|
protected TranslatorInterface $translator;
|
||||||
@ -42,7 +41,6 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||||
{
|
{
|
||||||
if (!$this->authorizationChecker->isGranted('ROLE_USER')) {
|
if (!$this->authorizationChecker->isGranted('ROLE_USER')) {
|
||||||
|
|
||||||
$menu->addChild($this->translator->trans('Homepage'), [
|
$menu->addChild($this->translator->trans('Homepage'), [
|
||||||
'route' => 'chill_main_homepage',
|
'route' => 'chill_main_homepage',
|
||||||
])
|
])
|
||||||
@ -61,7 +59,6 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($this->authorizationChecker->isGranted(ChillExportVoter::EXPORT)) {
|
if ($this->authorizationChecker->isGranted(ChillExportVoter::EXPORT)) {
|
||||||
$menu->addChild($this->translator->trans('Export Menu'), [
|
$menu->addChild($this->translator->trans('Export Menu'), [
|
||||||
'route' => 'chill_main_export_index',
|
'route' => 'chill_main_export_index',
|
||||||
|
@ -21,6 +21,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||||||
|
|
||||||
class UserMenuBuilder implements LocalMenuBuilderInterface
|
class UserMenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
|
private AuthorizationCheckerInterface $authorizationChecker;
|
||||||
|
|
||||||
private NotificationByUserCounter $notificationByUserCounter;
|
private NotificationByUserCounter $notificationByUserCounter;
|
||||||
|
|
||||||
private Security $security;
|
private Security $security;
|
||||||
@ -29,8 +31,6 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
|
|
||||||
private WorkflowByUserCounter $workflowByUserCounter;
|
private WorkflowByUserCounter $workflowByUserCounter;
|
||||||
|
|
||||||
private AuthorizationCheckerInterface $authorizationChecker;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
NotificationByUserCounter $notificationByUserCounter,
|
NotificationByUserCounter $notificationByUserCounter,
|
||||||
WorkflowByUserCounter $workflowByUserCounter,
|
WorkflowByUserCounter $workflowByUserCounter,
|
||||||
|
@ -57,7 +57,6 @@ class HouseholdMemberController extends ApiController
|
|||||||
*/
|
*/
|
||||||
public function editMembership(Request $request, HouseholdMember $member): Response
|
public function editMembership(Request $request, HouseholdMember $member): Response
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->denyAccessUnlessGranted(HouseholdVoter::EDIT, $member);
|
$this->denyAccessUnlessGranted(HouseholdVoter::EDIT, $member);
|
||||||
|
|
||||||
$form = $this->createForm(HouseholdMemberType::class, $member, [
|
$form = $this->createForm(HouseholdMemberType::class, $member, [
|
||||||
|
@ -94,7 +94,6 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
$workflow = $this->registry->get($period, 'accompanying_period_lifecycle');
|
$workflow = $this->registry->get($period, 'accompanying_period_lifecycle');
|
||||||
|
|
||||||
if ($this->security->isGranted(AccompanyingPeriodVoter::EDIT, $period)) {
|
if ($this->security->isGranted(AccompanyingPeriodVoter::EDIT, $period)) {
|
||||||
|
|
||||||
if (null !== $period->getClosingDate()) {
|
if (null !== $period->getClosingDate()) {
|
||||||
$menu->addChild($this->translator->trans('Re-open accompanying course'), [
|
$menu->addChild($this->translator->trans('Re-open accompanying course'), [
|
||||||
'route' => 'chill_person_accompanying_course_reopen',
|
'route' => 'chill_person_accompanying_course_reopen',
|
||||||
|
@ -77,7 +77,6 @@ class HouseholdMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
], ])
|
], ])
|
||||||
->setExtras(['order' => 30]);
|
->setExtras(['order' => 30]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getMenuIds(): array
|
public static function getMenuIds(): array
|
||||||
|
@ -51,7 +51,6 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||||
{
|
{
|
||||||
if ($this->security->isGranted(PersonVoter::SEE, $parameters['person'])) {
|
if ($this->security->isGranted(PersonVoter::SEE, $parameters['person'])) {
|
||||||
|
|
||||||
$menu->addChild($this->translator->trans('Person details'), [
|
$menu->addChild($this->translator->trans('Person details'), [
|
||||||
'route' => 'chill_person_view',
|
'route' => 'chill_person_view',
|
||||||
'routeParameters' => [
|
'routeParameters' => [
|
||||||
@ -106,6 +105,7 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
'order' => 100,
|
'order' => 100,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->security->isGranted(PersonVoter::SEE, $parameters['person'])) {
|
if ($this->security->isGranted(PersonVoter::SEE, $parameters['person'])) {
|
||||||
$menu->addChild($this->translator->trans('person_resources_menu'), [
|
$menu->addChild($this->translator->trans('person_resources_menu'), [
|
||||||
'route' => 'chill_person_resource_list',
|
'route' => 'chill_person_resource_list',
|
||||||
|
@ -32,6 +32,22 @@ class MenuBuilder implements LocalMenuBuilderInterface
|
|||||||
$this->authorizationChecker = $authorizationChecker;
|
$this->authorizationChecker = $authorizationChecker;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function buildAccompanyingCourseMenu($menu, $parameters)
|
||||||
|
{
|
||||||
|
$course = $parameters['accompanyingCourse'];
|
||||||
|
|
||||||
|
if ($this->authorizationChecker->isGranted(TaskVoter::SHOW, $course)) {
|
||||||
|
$menu->addChild(
|
||||||
|
$this->translator->trans('Tasks'),
|
||||||
|
[
|
||||||
|
'route' => 'chill_task_singletask_by-course_list',
|
||||||
|
'routeParameters' => ['id' => $course->getId()],
|
||||||
|
]
|
||||||
|
)
|
||||||
|
->setExtra('order', 400);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||||
{
|
{
|
||||||
switch ($menuId) {
|
switch ($menuId) {
|
||||||
@ -55,22 +71,6 @@ class MenuBuilder implements LocalMenuBuilderInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildAccompanyingCourseMenu($menu, $parameters)
|
|
||||||
{
|
|
||||||
$course = $parameters['accompanyingCourse'];
|
|
||||||
|
|
||||||
if ($this->authorizationChecker->isGranted(TaskVoter::SHOW, $course)) {
|
|
||||||
$menu->addChild(
|
|
||||||
$this->translator->trans('Tasks'),
|
|
||||||
[
|
|
||||||
'route' => 'chill_task_singletask_by-course_list',
|
|
||||||
'routeParameters' => ['id' => $course->getId()],
|
|
||||||
]
|
|
||||||
)
|
|
||||||
->setExtra('order', 400);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function buildPersonMenu($menu, $parameters)
|
public function buildPersonMenu($menu, $parameters)
|
||||||
{
|
{
|
||||||
//var $person \Chill\PersonBundle\Entity\Person */
|
//var $person \Chill\PersonBundle\Entity\Person */
|
||||||
|
@ -21,7 +21,6 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||||||
|
|
||||||
class UserMenuBuilder implements LocalMenuBuilderInterface
|
class UserMenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
public AuthorizationCheckerInterface $authorizationChecker;
|
public AuthorizationCheckerInterface $authorizationChecker;
|
||||||
|
|
||||||
public CountNotificationTask $counter;
|
public CountNotificationTask $counter;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user