add specific role for LIST and STAT

This commit is contained in:
2017-04-20 16:27:06 +02:00
parent 1bc93af148
commit be2edec605
5 changed files with 14 additions and 4 deletions

View File

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