mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 02:23:51 +00:00
add specific role for LIST and STAT
This commit is contained in:
@@ -24,6 +24,7 @@ use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
||||
use Doctrine\Common\Persistence\ObjectManager;
|
||||
use Chill\MainBundle\DataFixtures\ORM\LoadPermissionsGroup;
|
||||
use Chill\MainBundle\Entity\RoleScope;
|
||||
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||
|
||||
/**
|
||||
* Add a role CHILL_PERSON_UPDATE & CHILL_PERSON_CREATE for all groups except administrative,
|
||||
@@ -57,6 +58,14 @@ class LoadPersonACL extends AbstractFixture implements OrderedFixtureInterface
|
||||
->setRole('CHILL_PERSON_CREATE')
|
||||
->setScope(null);
|
||||
$permissionsGroup->addRoleScope($roleScopeCreate);
|
||||
$roleScopeList = (new RoleScope())
|
||||
->setRole(PersonVoter::LISTS)
|
||||
->setScope(null);
|
||||
$permissionsGroup->addRoleScope($roleScopeList);
|
||||
$roleScopeStats = (new RoleScope())
|
||||
->setRole(PersonVoter::STATS)
|
||||
->setScope(null);
|
||||
$permissionsGroup->addRoleScope($roleScopeStats);
|
||||
$manager->persist($roleScopeUpdate);
|
||||
$manager->persist($roleScopeCreate);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user