diff --git a/src/Bundle/ChillTaskBundle/Menu/MenuBuilder.php b/src/Bundle/ChillTaskBundle/Menu/MenuBuilder.php index 26f06d1b2..9b1890958 100644 --- a/src/Bundle/ChillTaskBundle/Menu/MenuBuilder.php +++ b/src/Bundle/ChillTaskBundle/Menu/MenuBuilder.php @@ -28,7 +28,7 @@ use Symfony\Component\Translation\TranslatorInterface; * * @author Julien Fastré */ -class PersonMenuBuilder implements LocalMenuBuilderInterface +class MenuBuilder implements LocalMenuBuilderInterface { /** * @@ -86,12 +86,10 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface public function buildAccompanyingCourseMenu($menu, $parameters){ - //var $person \Chill\PersonBundle\Entity\Person */ $course = $parameters['accompanyingCourse']; - //TODO: implement voter again? - // if ($this->authorizationChecker->isGranted(TaskVoter::SHOW, $course)) { + if ($this->authorizationChecker->isGranted(TaskVoter::SHOW, $course)) { $menu->addChild( $this->translator->trans('Tasks'), [ 'route' => 'chill_task_singletask_courselist', @@ -99,7 +97,7 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface [ 'course_id' => $course->getId() ] ]) ->setExtra('order', 400); - // } + } } public static function getMenuIds(): array diff --git a/src/Bundle/ChillTaskBundle/config/services/menu.yaml b/src/Bundle/ChillTaskBundle/config/services/menu.yaml index b4ff7a421..75726fcf4 100644 --- a/src/Bundle/ChillTaskBundle/config/services/menu.yaml +++ b/src/Bundle/ChillTaskBundle/config/services/menu.yaml @@ -1,23 +1,23 @@ services: - Chill\TaskBundle\Menu\UserMenuBuilder: - arguments: - $tokenStorage: '@Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface' - $counter: '@Chill\TaskBundle\Templating\UI\CountNotificationTask' - $translator: '@Symfony\Component\Translation\TranslatorInterface' - $authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface' - tags: - - { name: 'chill.menu_builder' } - - Chill\TaskBundle\Menu\PersonMenuBuilder: - arguments: - $authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface' - $translator: '@Symfony\Component\Translation\TranslatorInterface' - tags: - - { name: 'chill.menu_builder' } - - Chill\TaskBundle\Menu\SectionMenuBuilder: - arguments: - $authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface' - $translator: '@Symfony\Component\Translation\TranslatorInterface' - tags: - - { name: 'chill.menu_builder' } + Chill\TaskBundle\Menu\UserMenuBuilder: + arguments: + $tokenStorage: '@Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface' + $counter: '@Chill\TaskBundle\Templating\UI\CountNotificationTask' + $translator: '@Symfony\Component\Translation\TranslatorInterface' + $authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface' + tags: + - { name: "chill.menu_builder" } + + Chill\TaskBundle\Menu\MenuBuilder: + arguments: + $authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface' + $translator: '@Symfony\Component\Translation\TranslatorInterface' + tags: + - { name: "chill.menu_builder" } + + Chill\TaskBundle\Menu\SectionMenuBuilder: + arguments: + $authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface' + $translator: '@Symfony\Component\Translation\TranslatorInterface' + tags: + - { name: "chill.menu_builder" }