Details
-
Bug
-
Resolution: Obsolete
-
Medium
-
None
-
5.1
-
None
Description
roleService -> loadRoleByIdentifier( $roleIdentifier ) fails with the exception Could not find 'Limitation' with identifier 'Group' if UserGroup limitation is used in role.
steps to reproduce
- create a role and include the policy content | read | group:self
- attempt to load the role by it's identifier in a command
$repository = $this->getContainer()->get( 'ezpublish.api.repository' ); $repository->setCurrentUser( $repository->getUserService()->loadUser( 14 ) ); $roleService = $repository->getRoleService(); if ( !$role = $roleService->loadRoleByIdentifier( $roleIdentifier ) ) { $output->writeln( "Role $roleIdentifier not found" ); exit; }
The command will fail with
[eZ\Publish\Core\Base\Exceptions\NotFoundException]
Could not find 'Limitation' with identifier 'Group'
I believe the limitation is named UserGroup