Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

API/Repository/RoleService.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\API\Repository;
8
9 use eZ\Publish\API\Repository\Values\User\Limitation\RoleLimitation;
10 use eZ\Publish\API\Repository\Values\User\Policy;
11 use eZ\Publish\API\Repository\Values\User\PolicyCreateStruct;
12 use eZ\Publish\API\Repository\Values\User\PolicyDraft;
13 use eZ\Publish\API\Repository\Values\User\PolicyUpdateStruct;
14 use eZ\Publish\API\Repository\Values\User\Role;
15 use eZ\Publish\API\Repository\Values\User\RoleAssignment;
16 use eZ\Publish\API\Repository\Values\User\RoleCreateStruct;
17 use eZ\Publish\API\Repository\Values\User\RoleDraft;
18 use eZ\Publish\API\Repository\Values\User\RoleUpdateStruct;
19 use eZ\Publish\API\Repository\Values\User\User;
20 use eZ\Publish\API\Repository\Values\User\UserGroup;
21
25 interface RoleService
26 {
42 public function createRole(RoleCreateStruct $roleCreateStruct);
43
57 public function createRoleDraft(Role $role);
58
71 public function loadRoleDraft($id);
72
83 public function loadRoleDraftByRoleId($roleId);
84
98 public function updateRoleDraft(RoleDraft $roleDraft, RoleUpdateStruct $roleUpdateStruct);
99
115 public function addPolicyByRoleDraft(RoleDraft $roleDraft, PolicyCreateStruct $policyCreateStruct);
116
130 public function removePolicyByRoleDraft(RoleDraft $roleDraft, PolicyDraft $policyDraft);
131
149 public function updatePolicyByRoleDraft(RoleDraft $roleDraft, PolicyDraft $policy, PolicyUpdateStruct $policyUpdateStruct);
150
160 public function deleteRoleDraft(RoleDraft $roleDraft);
161
171 public function publishRoleDraft(RoleDraft $roleDraft);
172
186 public function updateRole(Role $role, RoleUpdateStruct $roleUpdateStruct);
187
203 public function addPolicy(Role $role, PolicyCreateStruct $policyCreateStruct);
204
214 public function deletePolicy(Policy $policy);
215
232 public function updatePolicy(Policy $policy, PolicyUpdateStruct $policyUpdateStruct);
233
244 public function loadRole($id);
245
256 public function loadRoleByIdentifier($identifier);
257
263 public function loadRoles();
264
272 public function deleteRole(Role $role);
273
285 public function loadPoliciesByUserId($userId);
286
298 public function assignRoleToUserGroup(Role $role, UserGroup $userGroup, RoleLimitation $roleLimitation = null);
299
311 public function unassignRoleFromUserGroup(Role $role, UserGroup $userGroup);
312
324 public function assignRoleToUser(Role $role, User $user, RoleLimitation $roleLimitation = null);
325
337 public function unassignRoleFromUser(Role $role, User $user);
338
349 public function loadRoleAssignment($roleAssignmentId);
350
360 public function getRoleAssignments(Role $role);
361
375 public function getRoleAssignmentsForUser(User $user, $inherited = false);
376
384 public function getRoleAssignmentsForUserGroup(UserGroup $userGroup);
385
395 public function removeRoleAssignment(RoleAssignment $roleAssignment);
396
404 public function newRoleCreateStruct($name);
405
414 public function newPolicyCreateStruct($module, $function);
415
421 public function newPolicyUpdateStruct();
422
428 public function newRoleUpdateStruct();
429
439 public function getLimitationType($identifier);
440
456 public function getLimitationTypesByModuleFunction($module, $function);
457 }
eZ\Publish\API\Repository\Values\User\Limitation\RoleLimitation
Definition: eZ/Publish/API/Repository/Values/User/Limitation/RoleLimitation.php:12
eZ\Publish\API\Repository\Values\User\PolicyCreateStruct
This class is used to create a policy.
Definition: API/Repository/Values/User/PolicyCreateStruct.php:13
eZ\Publish\API\Repository\Values\User\PolicyDraft
Definition: API/Repository/Values/User/PolicyDraft.php:13
eZ\Publish\API\Repository\Values\User\PolicyUpdateStruct
This class is used for updating a policy.
Definition: API/Repository/Values/User/PolicyUpdateStruct.php:14
eZ\Publish\API\Repository\Values\User\Policy
Definition: API/Repository/Values/User/Policy.php:21
eZ\Publish\API\Repository\Values\User\RoleAssignment
Definition: API/Repository/Values/User/RoleAssignment.php:18
eZ\Publish\API\Repository\Values\User\RoleCreateStruct
This class is used to create a new role.
Definition: API/Repository/Values/User/RoleCreateStruct.php:15
eZ\Publish\API\Repository\Values\User\RoleDraft
This class represents a draft of a role.
Definition: API/Repository/Values/User/RoleDraft.php:13
eZ\Publish\API\Repository\Values\User\RoleUpdateStruct
This class is used to update a role.
Definition: API/Repository/Values/User/RoleUpdateStruct.php:15
eZ\Publish\API\Repository\Values\User\Role
Definition: API/Repository/Values/User/Role.php:19
eZ\Publish\API\Repository\Values\User\UserGroup
Definition: API/Repository/Values/User/UserGroup.php:17
eZ\Publish\API\Repository\Values\User\User
Definition: Publish/API/Repository/Values/User/User.php:24
eZ\Publish\API\Repository\RoleService
This service provides methods for managing Roles and Policies.
Definition: API/Repository/RoleService.php:26
eZ\Publish\API\Repository\RoleService\getLimitationType
getLimitationType($identifier)
Returns the LimitationType registered with the given identifier.
eZ\Publish\API\Repository\RoleService\newPolicyCreateStruct
newPolicyCreateStruct($module, $function)
Instantiates a policy create class.
eZ\Publish\API\Repository\RoleService\addPolicy
addPolicy(Role $role, PolicyCreateStruct $policyCreateStruct)
Adds a new policy to the role.
eZ\Publish\API\Repository\RoleService\newRoleCreateStruct
newRoleCreateStruct($name)
Instantiates a role create class.
eZ\Publish\API\Repository\RoleService\loadRoleDraftByRoleId
loadRoleDraftByRoleId($roleId)
Loads a RoleDraft by the ID of the role it was created from.
eZ\Publish\API\Repository\RoleService\deletePolicy
deletePolicy(Policy $policy)
Deletes a policy.
eZ\Publish\API\Repository\RoleService\publishRoleDraft
publishRoleDraft(RoleDraft $roleDraft)
Publishes the given RoleDraft.
eZ\Publish\API\Repository\RoleService\assignRoleToUserGroup
assignRoleToUserGroup(Role $role, UserGroup $userGroup, RoleLimitation $roleLimitation=null)
Assigns a role to the given user group.
eZ\Publish\API\Repository\RoleService\getRoleAssignments
getRoleAssignments(Role $role)
Returns the assigned user and user groups to this role.
eZ\Publish\API\Repository\RoleService\getRoleAssignmentsForUserGroup
getRoleAssignmentsForUserGroup(UserGroup $userGroup)
Returns the UserGroupRoleAssignments assigned to the given UserGroup, excluding the ones the current ...
eZ\Publish\API\Repository\RoleService\updateRole
updateRole(Role $role, RoleUpdateStruct $roleUpdateStruct)
Updates the name of the role.
eZ\Publish\API\Repository\RoleService\getLimitationTypesByModuleFunction
getLimitationTypesByModuleFunction($module, $function)
Returns the LimitationType's assigned to a given module/function.
eZ\Publish\API\Repository\RoleService\loadPoliciesByUserId
loadPoliciesByUserId($userId)
Loads all policies from roles which are assigned to a user or to user groups to which the user belong...
eZ\Publish\API\Repository\RoleService\newRoleUpdateStruct
newRoleUpdateStruct()
Instantiates a policy update class.
eZ\Publish\API\Repository\RoleService\updatePolicyByRoleDraft
updatePolicyByRoleDraft(RoleDraft $roleDraft, PolicyDraft $policy, PolicyUpdateStruct $policyUpdateStruct)
Updates the limitations of a policy.
eZ\Publish\API\Repository\RoleService\removeRoleAssignment
removeRoleAssignment(RoleAssignment $roleAssignment)
Removes the given role assignment.
eZ\Publish\API\Repository\RoleService\removePolicyByRoleDraft
removePolicyByRoleDraft(RoleDraft $roleDraft, PolicyDraft $policyDraft)
Removes a policy from a RoleDraft.
eZ\Publish\API\Repository\RoleService\newPolicyUpdateStruct
newPolicyUpdateStruct()
Instantiates a policy update class.
eZ\Publish\API\Repository\RoleService\updatePolicy
updatePolicy(Policy $policy, PolicyUpdateStruct $policyUpdateStruct)
Updates the limitations of a policy.
eZ\Publish\API\Repository\RoleService\loadRoleDraft
loadRoleDraft($id)
Loads a RoleDraft for the given id.
eZ\Publish\API\Repository\RoleService\loadRoleByIdentifier
loadRoleByIdentifier($identifier)
Loads a role for the given identifier.
eZ\Publish\API\Repository\RoleService\deleteRoleDraft
deleteRoleDraft(RoleDraft $roleDraft)
Deletes the given RoleDraft.
eZ\Publish\API\Repository\RoleService\createRole
createRole(RoleCreateStruct $roleCreateStruct)
Creates a new RoleDraft.
eZ\Publish\API\Repository\RoleService\unassignRoleFromUser
unassignRoleFromUser(Role $role, User $user)
Removes a role from the given user.
eZ\Publish\API\Repository\RoleService\loadRoles
loadRoles()
Loads all roles, excluding the ones the current user is not allowed to read.
eZ\Publish\API\Repository\RoleService\loadRoleAssignment
loadRoleAssignment($roleAssignmentId)
Loads a role assignment for the given id.
eZ\Publish\API\Repository\RoleService\updateRoleDraft
updateRoleDraft(RoleDraft $roleDraft, RoleUpdateStruct $roleUpdateStruct)
Updates the properties of a RoleDraft.
eZ\Publish\API\Repository\RoleService\assignRoleToUser
assignRoleToUser(Role $role, User $user, RoleLimitation $roleLimitation=null)
Assigns a role to the given user.
eZ\Publish\API\Repository\RoleService\createRoleDraft
createRoleDraft(Role $role)
Creates a new RoleDraft for existing Role.
eZ\Publish\API\Repository\RoleService\loadRole
loadRole($id)
Loads a role for the given id.
eZ\Publish\API\Repository\RoleService\addPolicyByRoleDraft
addPolicyByRoleDraft(RoleDraft $roleDraft, PolicyCreateStruct $policyCreateStruct)
Adds a new policy to the RoleDraft.
eZ\Publish\API\Repository\RoleService\getRoleAssignmentsForUser
getRoleAssignmentsForUser(User $user, $inherited=false)
Returns UserRoleAssignments assigned to the given User, excluding the ones the current user is not al...
eZ\Publish\API\Repository\RoleService\deleteRole
deleteRole(Role $role)
Deletes the given role.
eZ\Publish\API\Repository\RoleService\unassignRoleFromUserGroup
unassignRoleFromUserGroup(Role $role, UserGroup $userGroup)
Removes a role from the given user group.
eZ\Publish\API\Repository
Definition: API/Repository/BookmarkService.php:9
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.