diff --git a/src/Bundle/ChillPersonBundle/Menu/SectionMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/SectionMenuBuilder.php index c95c5caf5..bc2aa104b 100644 --- a/src/Bundle/ChillPersonBundle/Menu/SectionMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/SectionMenuBuilder.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\PersonBundle\Menu; use Chill\MainBundle\Routing\LocalMenuBuilderInterface; +use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter; use Chill\PersonBundle\Security\Authorization\PersonVoter; use Knp\Menu\MenuItem; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; @@ -64,13 +65,15 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface ]); } - $menu->addChild($this->translator->trans('Accompanying courses of users'), [ - 'route' => 'chill_course_list_reassign', - ]) - ->setExtras([ - 'order' => 12, - 'icons' => ['task'], - ]); + // if ($this->authorizationChecker->isGranted(AccompanyingPeriodVoter::REASSIGN_BULK, null)) { + $menu->addChild($this->translator->trans('Accompanying courses of users'), [ + 'route' => 'chill_course_list_reassign', + ]) + ->setExtras([ + 'order' => 12, + 'icons' => ['task'], + ]); + // } } public static function getMenuIds(): array diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php index e53d40eee..37366dd01 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php @@ -34,6 +34,7 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH self::FULL, self::TOGGLE_CONFIDENTIAL_ALL, self::TOGGLE_INTENSITY, + self::REASSIGN_BULK self::RE_OPEN_COURSE, ]; @@ -87,6 +88,8 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH */ public const TOGGLE_INTENSITY = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_INTENSITY'; + public const REASSIGN_BULK ='CHILL_PERSON_ACCOMPANYING_COURSE_REASSIGN_BULK'; + private Security $security; private VoterHelperInterface $voterHelper;