beginning of ACL added

This commit is contained in:
Julie Lenaerts 2022-03-28 17:06:29 +02:00
parent 18025012a8
commit 38a26f0bc1
2 changed files with 13 additions and 7 deletions

View File

@ -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

View File

@ -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;