mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
add permission for list and stats
Required for tests. This will also allow for default user to execute reports
This commit is contained in:
parent
837beb4cb2
commit
b596a7a9c9
@ -25,6 +25,7 @@ use Doctrine\Common\Persistence\ObjectManager;
|
||||
use Chill\MainBundle\DataFixtures\ORM\LoadPermissionsGroup;
|
||||
use Chill\MainBundle\Entity\RoleScope;
|
||||
use Chill\MainBundle\DataFixtures\ORM\LoadScopes;
|
||||
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
||||
|
||||
/**
|
||||
* Add a role CHILL_ACTIVITY_UPDATE & CHILL_ACTIVITY_CREATE for all groups except administrative,
|
||||
@ -61,7 +62,7 @@ class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterfac
|
||||
break;
|
||||
}
|
||||
|
||||
printf("Adding CHILL_ACTIVITY_UPDATE & CHILL_ACTIVITY_CREATE & CHILL_ACTIVITY_DELETE to %s "
|
||||
printf("Adding CHILL_ACTIVITY_UPDATE & CHILL_ACTIVITY_CREATE & CHILL_ACTIVITY_DELETE, and stats and list permissions to %s "
|
||||
. "permission group, scope '%s' \n",
|
||||
$permissionsGroup->getName(), $scope->getName()['en']);
|
||||
$roleScopeUpdate = (new RoleScope())
|
||||
@ -76,6 +77,14 @@ class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterfac
|
||||
->setRole('CHILL_ACTIVITY_DELETE')
|
||||
->setScope($scope);
|
||||
$permissionsGroup->addRoleScope($roleScopeDelete);
|
||||
$roleScopeList = (new RoleScope())
|
||||
->setRole(ActivityStatsVoter::LISTS)
|
||||
;
|
||||
$permissionsGroup->addRoleScope($roleScopeList);
|
||||
$roleScopeStat = (new RoleScope())
|
||||
->setRole(ActivityStatsVoter::STATS)
|
||||
;
|
||||
$permissionsGroup->addRoleScope($roleScopeStat);
|
||||
|
||||
$manager->persist($roleScopeUpdate);
|
||||
$manager->persist($roleScopeCreate);
|
||||
|
Loading…
x
Reference in New Issue
Block a user