Property | Type | Description | |
---|---|---|---|
$limitationService | |||
$repository | eZ\Publish\API\Repository\Repository | ||
$roleDomainMapper | |||
$settings | array | ||
$userHandler | eZ\Publish\SPI\Persistence\User\Handler |
Method | Description | |
---|---|---|
__construct ( eZ\Publish\API\Repository\Repository $repository, eZ\Publish\SPI\Persistence\User\Handler $userHandler, |
Setups service with reference to repository object that created it & corresponding handler. | |
addPolicy ( eZ\Publish\API\Repository\Values\User\Role $role, eZ\Publish\API\Repository\Values\User\PolicyCreateStruct $policyCreateStruct ) : eZ\Publish\API\Repository\Values\User\Role | Adds a new policy to the role. | |
addPolicyByRoleDraft ( eZ\Publish\API\Repository\Values\User\RoleDraft $roleDraft, eZ\Publish\API\Repository\Values\User\PolicyCreateStruct $policyCreateStruct ) : eZ\Publish\API\Repository\Values\User\RoleDraft | Adds a new policy to the RoleDraft. | |
assignRoleToUser ( eZ\Publish\API\Repository\Values\User\Role $role, eZ\Publish\API\Repository\Values\User\User $user, eZ\Publish\API\Repository\Values\User\Limitation\RoleLimitation $roleLimitation = null ) | Assigns a role to the given user. | |
assignRoleToUserGroup ( eZ\Publish\API\Repository\Values\User\Role $role, eZ\Publish\API\Repository\Values\User\UserGroup $userGroup, eZ\Publish\API\Repository\Values\User\Limitation\RoleLimitation $roleLimitation = null ) | Assigns a role to the given user group. | |
createRole ( eZ\Publish\API\Repository\Values\User\RoleCreateStruct $roleCreateStruct ) : eZ\Publish\API\Repository\Values\User\RoleDraft | Creates a new RoleDraft. | |
createRoleDraft ( eZ\Publish\API\Repository\Values\User\Role $role ) : eZ\Publish\API\Repository\Values\User\RoleDraft | Creates a new RoleDraft for an existing Role. | |
deletePolicy ( eZ\Publish\API\Repository\Values\User\Policy $policy ) | Deletes a policy. | |
deleteRole ( eZ\Publish\API\Repository\Values\User\Role $role ) | Deletes the given role. | |
deleteRoleDraft ( eZ\Publish\API\Repository\Values\User\RoleDraft $roleDraft ) | Deletes the given RoleDraft. | |
getLimitationType ( string $identifier ) : eZ\Publish\SPI\Limitation\Type | Returns the LimitationType registered with the given identifier. | |
getLimitationTypesByModuleFunction ( string $module, string $function ) : eZ\Publish\SPI\Limitation\Type[] | Returns the LimitationType's assigned to a given module/function. | |
getRoleAssignments ( eZ\Publish\API\Repository\Values\User\Role $role ) : eZ\Publish\API\Repository\Values\User\RoleAssignment[] | Returns the assigned user and user groups to this role. | |
getRoleAssignmentsForUser ( eZ\Publish\API\Repository\Values\User\User $user, $inherited = false ) | ||
getRoleAssignmentsForUserGroup ( eZ\Publish\API\Repository\Values\User\UserGroup $userGroup ) : eZ\Publish\API\Repository\Values\User\UserGroupRoleAssignment[] | Returns the roles assigned to the given user group. | |
loadPoliciesByUserId ( mixed $userId ) : eZ\Publish\API\Repository\Values\User\Policy[] | Loads all policies from roles which are assigned to a user or to user groups to which the user belongs. | |
loadRole ( mixed $id ) : eZ\Publish\API\Repository\Values\User\Role | Loads a role for the given id. | |
loadRoleAssignment ( mixed $roleAssignmentId ) : eZ\Publish\API\Repository\Values\User\RoleAssignment | Loads a role assignment for the given id. | |
loadRoleByIdentifier ( string $identifier ) : eZ\Publish\API\Repository\Values\User\Role | Loads a role for the given identifier. | |
loadRoleDraft ( mixed $id ) : eZ\Publish\API\Repository\Values\User\RoleDraft | Loads a RoleDraft for the given id. | |
loadRoleDraftByRoleId ( mixed $roleId ) : eZ\Publish\API\Repository\Values\User\RoleDraft | Loads a RoleDraft by the ID of the role it was created from. | |
loadRoles ( ) : eZ\Publish\API\Repository\Values\User\Role[] | Loads all roles. | |
newPolicyCreateStruct ( string $module, string $function ) : eZ\Publish\API\Repository\Values\User\PolicyCreateStruct | Instantiates a policy create class. | |
newPolicyUpdateStruct ( ) : eZ\Publish\API\Repository\Values\User\PolicyUpdateStruct | Instantiates a policy update class. | |
newRoleCreateStruct ( string $name ) : eZ\Publish\API\Repository\Values\User\RoleCreateStruct | Instantiates a role create class. | |
newRoleUpdateStruct ( ) : eZ\Publish\API\Repository\Values\User\RoleUpdateStruct | Instantiates a policy update class. | |
publishRoleDraft ( eZ\Publish\API\Repository\Values\User\RoleDraft $roleDraft ) | Publishes a given RoleDraft. | |
removePolicy ( eZ\Publish\API\Repository\Values\User\Role $role, eZ\Publish\API\Repository\Values\User\Policy $policy ) : eZ\Publish\API\Repository\Values\User\Role | Removes a policy from the role. | |
removePolicyByRoleDraft ( eZ\Publish\API\Repository\Values\User\RoleDraft $roleDraft, eZ\Publish\API\Repository\Values\User\PolicyDraft $policyDraft ) : eZ\Publish\API\Repository\Values\User\RoleDraft | Removes a policy from a RoleDraft. | |
removeRoleAssignment ( eZ\Publish\API\Repository\Values\User\RoleAssignment $roleAssignment ) | Removes the given role assignment. | |
unassignRoleFromUser ( eZ\Publish\API\Repository\Values\User\Role $role, eZ\Publish\API\Repository\Values\User\User $user ) | removes a role from the given user. | |
unassignRoleFromUserGroup ( eZ\Publish\API\Repository\Values\User\Role $role, eZ\Publish\API\Repository\Values\User\UserGroup $userGroup ) | removes a role from the given user group. | |
updatePolicy ( eZ\Publish\API\Repository\Values\User\Policy $policy, eZ\Publish\API\Repository\Values\User\PolicyUpdateStruct $policyUpdateStruct ) : eZ\Publish\API\Repository\Values\User\Policy | Updates the limitations of a policy. The module and function cannot be changed and the limitations are replaced by the ones in $roleUpdateStruct. | |
updatePolicyByRoleDraft ( eZ\Publish\API\Repository\Values\User\RoleDraft $roleDraft, eZ\Publish\API\Repository\Values\User\PolicyDraft $policy, eZ\Publish\API\Repository\Values\User\PolicyUpdateStruct $policyUpdateStruct ) : eZ\Publish\API\Repository\Values\User\PolicyDraft | Updates the limitations of a policy. The module and function cannot be changed and the limitations are replaced by the ones in $roleUpdateStruct. | |
updateRole ( eZ\Publish\API\Repository\Values\User\Role $role, eZ\Publish\API\Repository\Values\User\RoleUpdateStruct $roleUpdateStruct ) : eZ\Publish\API\Repository\Values\User\Role | Updates the name of the role. | |
updateRoleDraft ( eZ\Publish\API\Repository\Values\User\RoleDraft $roleDraft, eZ\Publish\API\Repository\Values\User\RoleUpdateStruct $roleUpdateStruct ) : eZ\Publish\API\Repository\Values\User\RoleDraft | Updates the properties of a RoleDraft. |
Method | Description | |
---|---|---|
checkAssignmentAndFilterLimitationValues ( mixed $contentId, eZ\Publish\SPI\Persistence\User\Role $spiRole, array $limitation = null ) : array[] | null | Validate that assignments not already exists and filter validations against existing. | |
internalDeletePolicy ( eZ\Publish\API\Repository\Values\User\Policy $policy ) | Deletes a policy. | |
validatePolicy ( string $module, string $function, array $limitations ) : |
Validates Policy context: Limitations on a module and function. | |
validateRoleCreateStruct ( eZ\Publish\API\Repository\Values\User\RoleCreateStruct $roleCreateStruct ) : |
Validates Policies and Limitations in Role create struct. |
public __construct ( eZ\Publish\API\Repository\Repository $repository, eZ\Publish\SPI\Persistence\User\Handler $userHandler, |
||
$repository | eZ\Publish\API\Repository\Repository | |
$userHandler | eZ\Publish\SPI\Persistence\User\Handler | |
$limitationService | ||
$roleDomainMapper | ||
$settings | array |
public addPolicy ( eZ\Publish\API\Repository\Values\User\Role $role, eZ\Publish\API\Repository\Values\User\PolicyCreateStruct $policyCreateStruct ) : eZ\Publish\API\Repository\Values\User\Role | ||
$role | eZ\Publish\API\Repository\Values\User\Role | |
$policyCreateStruct | eZ\Publish\API\Repository\Values\User\PolicyCreateStruct | |
return | eZ\Publish\API\Repository\Values\User\Role |
public addPolicyByRoleDraft ( eZ\Publish\API\Repository\Values\User\RoleDraft $roleDraft, eZ\Publish\API\Repository\Values\User\PolicyCreateStruct $policyCreateStruct ) : eZ\Publish\API\Repository\Values\User\RoleDraft | ||
$roleDraft | eZ\Publish\API\Repository\Values\User\RoleDraft | |
$policyCreateStruct | eZ\Publish\API\Repository\Values\User\PolicyCreateStruct | |
return | eZ\Publish\API\Repository\Values\User\RoleDraft |
public assignRoleToUser ( eZ\Publish\API\Repository\Values\User\Role $role, eZ\Publish\API\Repository\Values\User\User $user, eZ\Publish\API\Repository\Values\User\Limitation\RoleLimitation $roleLimitation = null ) | ||
$role | eZ\Publish\API\Repository\Values\User\Role | |
$user | eZ\Publish\API\Repository\Values\User\User | |
$roleLimitation | eZ\Publish\API\Repository\Values\User\Limitation\RoleLimitation | an optional role limitation (which is either a subtree limitation or section limitation) |
public assignRoleToUserGroup ( eZ\Publish\API\Repository\Values\User\Role $role, eZ\Publish\API\Repository\Values\User\UserGroup $userGroup, eZ\Publish\API\Repository\Values\User\Limitation\RoleLimitation $roleLimitation = null ) | ||
$role | eZ\Publish\API\Repository\Values\User\Role | |
$userGroup | eZ\Publish\API\Repository\Values\User\UserGroup | |
$roleLimitation | eZ\Publish\API\Repository\Values\User\Limitation\RoleLimitation | an optional role limitation (which is either a subtree limitation or section limitation) |
public createRole ( eZ\Publish\API\Repository\Values\User\RoleCreateStruct $roleCreateStruct ) : eZ\Publish\API\Repository\Values\User\RoleDraft | ||
$roleCreateStruct | eZ\Publish\API\Repository\Values\User\RoleCreateStruct | |
return | eZ\Publish\API\Repository\Values\User\RoleDraft |
public createRoleDraft ( eZ\Publish\API\Repository\Values\User\Role $role ) : eZ\Publish\API\Repository\Values\User\RoleDraft | ||
$role | eZ\Publish\API\Repository\Values\User\Role | |
return | eZ\Publish\API\Repository\Values\User\RoleDraft |
public deletePolicy ( eZ\Publish\API\Repository\Values\User\Policy $policy ) | ||
$policy | eZ\Publish\API\Repository\Values\User\Policy | the policy to delete |
public deleteRole ( eZ\Publish\API\Repository\Values\User\Role $role ) | ||
$role | eZ\Publish\API\Repository\Values\User\Role |
public deleteRoleDraft ( eZ\Publish\API\Repository\Values\User\RoleDraft $roleDraft ) | ||
$roleDraft | eZ\Publish\API\Repository\Values\User\RoleDraft |
public getLimitationType ( string $identifier ) : eZ\Publish\SPI\Limitation\Type | ||
$identifier | string | |
return | eZ\Publish\SPI\Limitation\Type |
public getLimitationTypesByModuleFunction ( string $module, string $function ) : eZ\Publish\SPI\Limitation\Type[] | ||
$module | string | Legacy name of "controller", it's a unique identifier like "content" |
$function | string | Legacy name of a controller "action", it's a unique within the controller like "read" |
return | eZ\Publish\SPI\Limitation\Type[] |
public getRoleAssignments ( eZ\Publish\API\Repository\Values\User\Role $role ) : eZ\Publish\API\Repository\Values\User\RoleAssignment[] | ||
$role | eZ\Publish\API\Repository\Values\User\Role | |
return | eZ\Publish\API\Repository\Values\User\RoleAssignment[] |
public getRoleAssignmentsForUser ( eZ\Publish\API\Repository\Values\User\User $user, $inherited = false ) | ||
$user | eZ\Publish\API\Repository\Values\User\User |
public getRoleAssignmentsForUserGroup ( eZ\Publish\API\Repository\Values\User\UserGroup $userGroup ) : eZ\Publish\API\Repository\Values\User\UserGroupRoleAssignment[] | ||
$userGroup | eZ\Publish\API\Repository\Values\User\UserGroup | |
return | eZ\Publish\API\Repository\Values\User\UserGroupRoleAssignment[] |
protected internalDeletePolicy ( eZ\Publish\API\Repository\Values\User\Policy $policy ) | ||
$policy | eZ\Publish\API\Repository\Values\User\Policy |
public loadPoliciesByUserId ( mixed $userId ) : eZ\Publish\API\Repository\Values\User\Policy[] | ||
$userId | mixed | |
return | eZ\Publish\API\Repository\Values\User\Policy[] |
public loadRoleAssignment ( mixed $roleAssignmentId ) : eZ\Publish\API\Repository\Values\User\RoleAssignment | ||
$roleAssignmentId | mixed | |
return | eZ\Publish\API\Repository\Values\User\RoleAssignment |
public loadRoleByIdentifier ( string $identifier ) : eZ\Publish\API\Repository\Values\User\Role | ||
$identifier | string | |
return | eZ\Publish\API\Repository\Values\User\Role |
public loadRoleDraft ( mixed $id ) : eZ\Publish\API\Repository\Values\User\RoleDraft | ||
$id | mixed | |
return | eZ\Publish\API\Repository\Values\User\RoleDraft |
public loadRoleDraftByRoleId ( mixed $roleId ) : eZ\Publish\API\Repository\Values\User\RoleDraft | ||
$roleId | mixed | ID of the role the draft was created from. |
return | eZ\Publish\API\Repository\Values\User\RoleDraft |
public loadRoles ( ) : eZ\Publish\API\Repository\Values\User\Role[] | ||
return | eZ\Publish\API\Repository\Values\User\Role[] |
public newPolicyCreateStruct ( string $module, string $function ) : eZ\Publish\API\Repository\Values\User\PolicyCreateStruct | ||
$module | string | |
$function | string | |
return | eZ\Publish\API\Repository\Values\User\PolicyCreateStruct |
public newPolicyUpdateStruct ( ) : eZ\Publish\API\Repository\Values\User\PolicyUpdateStruct | ||
return | eZ\Publish\API\Repository\Values\User\PolicyUpdateStruct |
public newRoleCreateStruct ( string $name ) : eZ\Publish\API\Repository\Values\User\RoleCreateStruct | ||
$name | string | |
return | eZ\Publish\API\Repository\Values\User\RoleCreateStruct |
public newRoleUpdateStruct ( ) : eZ\Publish\API\Repository\Values\User\RoleUpdateStruct | ||
return | eZ\Publish\API\Repository\Values\User\RoleUpdateStruct |
public publishRoleDraft ( eZ\Publish\API\Repository\Values\User\RoleDraft $roleDraft ) | ||
$roleDraft | eZ\Publish\API\Repository\Values\User\RoleDraft |
public removePolicy ( eZ\Publish\API\Repository\Values\User\Role $role, eZ\Publish\API\Repository\Values\User\Policy $policy ) : eZ\Publish\API\Repository\Values\User\Role | ||
$role | eZ\Publish\API\Repository\Values\User\Role | |
$policy | eZ\Publish\API\Repository\Values\User\Policy | the policy to remove from the role |
return | eZ\Publish\API\Repository\Values\User\Role | the updated role |
public removePolicyByRoleDraft ( eZ\Publish\API\Repository\Values\User\RoleDraft $roleDraft, eZ\Publish\API\Repository\Values\User\PolicyDraft $policyDraft ) : eZ\Publish\API\Repository\Values\User\RoleDraft | ||
$roleDraft | eZ\Publish\API\Repository\Values\User\RoleDraft | |
$policyDraft | eZ\Publish\API\Repository\Values\User\PolicyDraft | the policy to remove from the RoleDraft |
return | eZ\Publish\API\Repository\Values\User\RoleDraft | if the authenticated user is not allowed to remove a policy |
public removeRoleAssignment ( eZ\Publish\API\Repository\Values\User\RoleAssignment $roleAssignment ) | ||
$roleAssignment | eZ\Publish\API\Repository\Values\User\RoleAssignment |
public unassignRoleFromUser ( eZ\Publish\API\Repository\Values\User\Role $role, eZ\Publish\API\Repository\Values\User\User $user ) | ||
$role | eZ\Publish\API\Repository\Values\User\Role | |
$user | eZ\Publish\API\Repository\Values\User\User |
public unassignRoleFromUserGroup ( eZ\Publish\API\Repository\Values\User\Role $role, eZ\Publish\API\Repository\Values\User\UserGroup $userGroup ) | ||
$role | eZ\Publish\API\Repository\Values\User\Role | |
$userGroup | eZ\Publish\API\Repository\Values\User\UserGroup |
public updatePolicy ( eZ\Publish\API\Repository\Values\User\Policy $policy, eZ\Publish\API\Repository\Values\User\PolicyUpdateStruct $policyUpdateStruct ) : eZ\Publish\API\Repository\Values\User\Policy | ||
$policy | eZ\Publish\API\Repository\Values\User\Policy | |
$policyUpdateStruct | eZ\Publish\API\Repository\Values\User\PolicyUpdateStruct | |
return | eZ\Publish\API\Repository\Values\User\Policy |
public updatePolicyByRoleDraft ( eZ\Publish\API\Repository\Values\User\RoleDraft $roleDraft, eZ\Publish\API\Repository\Values\User\PolicyDraft $policy, eZ\Publish\API\Repository\Values\User\PolicyUpdateStruct $policyUpdateStruct ) : eZ\Publish\API\Repository\Values\User\PolicyDraft | ||
$roleDraft | eZ\Publish\API\Repository\Values\User\RoleDraft | |
$policy | eZ\Publish\API\Repository\Values\User\PolicyDraft | |
$policyUpdateStruct | eZ\Publish\API\Repository\Values\User\PolicyUpdateStruct | |
return | eZ\Publish\API\Repository\Values\User\PolicyDraft |
public updateRole ( eZ\Publish\API\Repository\Values\User\Role $role, eZ\Publish\API\Repository\Values\User\RoleUpdateStruct $roleUpdateStruct ) : eZ\Publish\API\Repository\Values\User\Role | ||
$role | eZ\Publish\API\Repository\Values\User\Role | |
$roleUpdateStruct | eZ\Publish\API\Repository\Values\User\RoleUpdateStruct | |
return | eZ\Publish\API\Repository\Values\User\Role |
public updateRoleDraft ( eZ\Publish\API\Repository\Values\User\RoleDraft $roleDraft, eZ\Publish\API\Repository\Values\User\RoleUpdateStruct $roleUpdateStruct ) : eZ\Publish\API\Repository\Values\User\RoleDraft | ||
$roleDraft | eZ\Publish\API\Repository\Values\User\RoleDraft | |
$roleUpdateStruct | eZ\Publish\API\Repository\Values\User\RoleUpdateStruct | |
return | eZ\Publish\API\Repository\Values\User\RoleDraft |
protected validateRoleCreateStruct ( eZ\Publish\API\Repository\Values\User\RoleCreateStruct $roleCreateStruct ) : |
||
$roleCreateStruct | eZ\Publish\API\Repository\Values\User\RoleCreateStruct | |
return |
protected LimitationService,eZ\Publish\Core\Repository\Helper $limitationService | ||
return |
protected Repository,eZ\Publish\API\Repository $repository | ||
return | eZ\Publish\API\Repository\Repository |
protected RoleDomainMapper,eZ\Publish\Core\Repository\Helper $roleDomainMapper | ||
return |