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

Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
eZ\Publish\Core\Repository\RoleService Class Reference

This service provides methods for managing Roles and Policies. More...

Inheritance diagram for eZ\Publish\Core\Repository\RoleService:

## Public Member Functions
| __construct (RepositoryInterface $repository, Handler $userHandler, Helper\LimitationService $limitationService, Helper\RoleDomainMapper $roleDomainMapper, array $settings=[])
| Setups service with reference to repository object that created it & corresponding handler. More...
| createRole (APIRoleCreateStruct $roleCreateStruct)
| Creates a new RoleDraft. More...
| createRoleDraft (APIRole $role)
| Creates a new RoleDraft for an existing Role. More...
| loadRoleDraft ($id)
| Loads a RoleDraft for the given id. More...
| loadRoleDraftByRoleId ($roleId)
| Loads a RoleDraft by the ID of the role it was created from. More...
| updateRoleDraft (APIRoleDraft $roleDraft, RoleUpdateStruct $roleUpdateStruct)
| Updates the properties of a RoleDraft. More...
| addPolicyByRoleDraft (APIRoleDraft $roleDraft, APIPolicyCreateStruct $policyCreateStruct)
| Adds a new policy to the RoleDraft. More...
| removePolicyByRoleDraft (APIRoleDraft $roleDraft, PolicyDraft $policyDraft)
| Removes a policy from a RoleDraft. More...
| updatePolicyByRoleDraft (APIRoleDraft $roleDraft, PolicyDraft $policy, APIPolicyUpdateStruct $policyUpdateStruct)
| Updates the limitations of a policy. More...
| deleteRoleDraft (APIRoleDraft $roleDraft)
| Deletes the given RoleDraft. More...
| publishRoleDraft (APIRoleDraft $roleDraft)
| Publishes a given RoleDraft. More...
| updateRole (APIRole $role, RoleUpdateStruct $roleUpdateStruct)
| Updates the name of the role. More...
| addPolicy (APIRole $role, APIPolicyCreateStruct $policyCreateStruct)
| Adds a new policy to the role. More...
| deletePolicy (APIPolicy $policy)
| Deletes a policy. More...
| updatePolicy (APIPolicy $policy, APIPolicyUpdateStruct $policyUpdateStruct)
| Updates the limitations of a policy. More...
| loadRole ($id)
| Loads a role for the given id. More...
| loadRoleByIdentifier ($identifier)
| Loads a role for the given identifier. More...
| loadRoles ()
| Loads all roles, excluding the ones the current user is not allowed to read. More...
| deleteRole (APIRole $role)
| Deletes the given role. More...
| loadPoliciesByUserId ($userId)
| Loads all policies from roles which are assigned to a user or to user groups to which the user belongs. More...
| assignRoleToUserGroup (APIRole $role, UserGroup $userGroup, RoleLimitation $roleLimitation=null)
| Assigns a role to the given user group. More...
| unassignRoleFromUserGroup (APIRole $role, UserGroup $userGroup)
| removes a role from the given user group. More...
| assignRoleToUser (APIRole $role, User $user, RoleLimitation $roleLimitation=null)
| Assigns a role to the given user. More...
| unassignRoleFromUser (APIRole $role, User $user)
| removes a role from the given user. More...
| removeRoleAssignment (RoleAssignment $roleAssignment)
| Removes the given role assignment. More...
| loadRoleAssignment ($roleAssignmentId)
| Loads a role assignment for the given id. More...
| getRoleAssignments (APIRole $role)
| Returns the assigned user and user groups to this role. More...
| getRoleAssignmentsForUser (User $user, $inherited=false)
| getRoleAssignmentsForUserGroup (UserGroup $userGroup)
| Returns the roles assigned to the given user group, excluding the ones the current user is not allowed to read. More...
| newRoleCreateStruct ($name)
| Instantiates a role create class. More...
| newPolicyCreateStruct ($module, $function)
| Instantiates a policy create class. More...
| newPolicyUpdateStruct ()
| Instantiates a policy update class. More...
| newRoleUpdateStruct ()
| Instantiates a policy update class. More...
| getLimitationType ($identifier)
| Returns the LimitationType registered with the given identifier. More...
| getLimitationTypesByModuleFunction ($module, $function)
| Returns the LimitationType's assigned to a given module/function. More...
Public Member Functions inherited from eZ\Publish\API\Repository\RoleService
| createRole (RoleCreateStruct $roleCreateStruct)
| Creates a new RoleDraft. More...
| createRoleDraft (Role $role)
| Creates a new RoleDraft for existing Role. More...
| updateRoleDraft (RoleDraft $roleDraft, RoleUpdateStruct $roleUpdateStruct)
| Updates the properties of a RoleDraft. More...
| addPolicyByRoleDraft (RoleDraft $roleDraft, PolicyCreateStruct $policyCreateStruct)
| Adds a new policy to the RoleDraft. More...
| removePolicyByRoleDraft (RoleDraft $roleDraft, PolicyDraft $policyDraft)
| Removes a policy from a RoleDraft. More...
| updatePolicyByRoleDraft (RoleDraft $roleDraft, PolicyDraft $policy, PolicyUpdateStruct $policyUpdateStruct)
| Updates the limitations of a policy. More...
| deleteRoleDraft (RoleDraft $roleDraft)
| Deletes the given RoleDraft. More...
| publishRoleDraft (RoleDraft $roleDraft)
| Publishes the given RoleDraft. More...
| updateRole (Role $role, RoleUpdateStruct $roleUpdateStruct)
| Updates the name of the role. More...
| addPolicy (Role $role, PolicyCreateStruct $policyCreateStruct)
| Adds a new policy to the role. More...
| deletePolicy (Policy $policy)
| Deletes a policy. More...
| updatePolicy (Policy $policy, PolicyUpdateStruct $policyUpdateStruct)
| Updates the limitations of a policy. More...
| deleteRole (Role $role)
| Deletes the given role. More...
| assignRoleToUserGroup (Role $role, UserGroup $userGroup, RoleLimitation $roleLimitation=null)
| Assigns a role to the given user group. More...
| unassignRoleFromUserGroup (Role $role, UserGroup $userGroup)
| Removes a role from the given user group. More...
| assignRoleToUser (Role $role, User $user, RoleLimitation $roleLimitation=null)
| Assigns a role to the given user. More...
| unassignRoleFromUser (Role $role, User $user)
| Removes a role from the given user. More...
| getRoleAssignments (Role $role)
| Returns the assigned user and user groups to this role. More...

## Protected Member Functions
| internalDeletePolicy (APIPolicy $policy)
| Deletes a policy. More...
| validateRoleCreateStruct (APIRoleCreateStruct $roleCreateStruct)
| Validates Policies and Limitations in Role create struct. More...
| validatePolicy ($module, $function, array $limitations)
| Validates Policy context: Limitations on a module and function. More...
| checkAssignmentAndFilterLimitationValues ($contentId, SPIRole $spiRole, array $limitation=null)
| Validate that assignments not already exists and filter validations against existing. More...

## Protected Attributes
| $repository
| $userHandler
| $limitationService
| $roleDomainMapper
| $settings

## Private Attributes
| $permissionResolver

## Detailed Description

This service provides methods for managing Roles and Policies.

Definition at line 42 of file Core/Repository/RoleService.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\Repository\RoleService::__construct | ( | RepositoryInterface | $repository,
|  | Handler | $userHandler,
|  | Helper\LimitationService | $limitationService,
|  | Helper\RoleDomainMapper | $roleDomainMapper,
|  | array | $settings = `[]`
| ) |  |

Setups service with reference to repository object that created it & corresponding handler.

Parameters

  \eZ\Publish\API\Repository\Repository | $repository |
  \eZ\Publish\SPI\Persistence\User\Handler | $userHandler |
  \eZ\Publish\Core\Repository\Helper\LimitationService | $limitationService |
  \eZ\Publish\Core\Repository\Helper\RoleDomainMapper | $roleDomainMapper |
  array | $settings |

Definition at line 71 of file Core/Repository/RoleService.php.

References eZ\Publish\Core\Repository\RoleService\$limitationService, eZ\Publish\Core\Repository\RoleService\$repository, eZ\Publish\Core\Repository\RoleService\$roleDomainMapper, eZ\Publish\Core\Repository\RoleService\$settings, and eZ\Publish\Core\Repository\RoleService\$userHandler.

## Member Function Documentation

## ◆ addPolicy()

eZ\Publish\Core\Repository\RoleService::addPolicy | ( | APIRole | $role,
|  | APIPolicyCreateStruct | $policyCreateStruct
| ) |  |

Adds a new policy to the role.

Deprecated:
  since 6.0, use {

See also
  addPolicyByRoleDraft}

Exceptions

Definition at line 584 of file Core/Repository/RoleService.php.

References eZ\Publish\Core\Repository\RoleService\loadRole(), and eZ\Publish\Core\Repository\RoleService\validatePolicy().

## ◆ addPolicyByRoleDraft()

eZ\Publish\Core\Repository\RoleService::addPolicyByRoleDraft | ( | APIRoleDraft | $roleDraft,
|  | APIPolicyCreateStruct | $policyCreateStruct
| ) |  |

Adds a new policy to the RoleDraft.

Since
  6.0

Exceptions

Definition at line 309 of file Core/Repository/RoleService.php.

References eZ\Publish\Core\Repository\RoleService\loadRoleDraft(), and eZ\Publish\Core\Repository\RoleService\validatePolicy().

## ◆ assignRoleToUser()

eZ\Publish\Core\Repository\RoleService::assignRoleToUser | ( | APIRole | $role,
|  | User | $user,
|  | RoleLimitation | $roleLimitation = `null`
| ) |  |

Assigns a role to the given user.

Exceptions

Definition at line 956 of file Core/Repository/RoleService.php.

References eZ\Publish\Core\Repository\RoleService\checkAssignmentAndFilterLimitationValues().

## ◆ assignRoleToUserGroup()

eZ\Publish\Core\Repository\RoleService::assignRoleToUserGroup | ( | APIRole | $role,
|  | UserGroup | $userGroup,
|  | RoleLimitation | $roleLimitation = `null`
| ) |  |

Assigns a role to the given user group.

Exceptions

Definition at line 867 of file Core/Repository/RoleService.php.

References eZ\Publish\Core\Repository\RoleService\checkAssignmentAndFilterLimitationValues().

## ◆ checkAssignmentAndFilterLimitationValues()

eZ\Publish\Core\Repository\RoleService::checkAssignmentAndFilterLimitationValues | ( |  | $contentId,
|  | SPIRole | $spiRole,
|  | array | $limitation = `null`
| ) |  |
| protected

Validate that assignments not already exists and filter validations against existing.

Parameters

  mixed | $contentId |
  SPIRole | $spiRole |
  array | null | $limitation |

Returns
  array[]|null Filtered version of $limitation

Exceptions

Definition at line 1401 of file Core/Repository/RoleService.php.

Referenced by eZ\Publish\Core\Repository\RoleService\assignRoleToUser(), and eZ\Publish\Core\Repository\RoleService\assignRoleToUserGroup().

## ◆ createRole()

eZ\Publish\Core\Repository\RoleService::createRole | ( | APIRoleCreateStruct | $roleCreateStruct | ) |

Creates a new RoleDraft.

Since
  6.0

Exceptions

Definition at line 101 of file Core/Repository/RoleService.php.

References eZ\Publish\Core\Repository\RoleService\loadRoleByIdentifier(), and eZ\Publish\Core\Repository\RoleService\validateRoleCreateStruct().

## ◆ createRoleDraft()

eZ\Publish\Core\Repository\RoleService::createRoleDraft | ( | APIRole | $role | ) |

Creates a new RoleDraft for an existing Role.

Since
  6.0

Exceptions

Definition at line 154 of file Core/Repository/RoleService.php.

References eZ\Publish\API\Repository\Values\User\Role\STATUS_DRAFT.

## ◆ deletePolicy()

eZ\Publish\Core\Repository\RoleService::deletePolicy | ( | APIPolicy | $policy | ) |

Deletes a policy.

Deprecated:
  since 6.0, use removePolicyByRoleDraft() instead.

Exceptions

Definition at line 641 of file Core/Repository/RoleService.php.

References eZ\Publish\Core\Repository\RoleService\internalDeletePolicy().

## ◆ deleteRole()

eZ\Publish\Core\Repository\RoleService::deleteRole | ( | APIRole | $role | ) |

Deletes the given role.

Exceptions

Definition at line 813 of file Core/Repository/RoleService.php.

References eZ\Publish\Core\Repository\RoleService\loadRole().

## ◆ deleteRoleDraft()

eZ\Publish\Core\Repository\RoleService::deleteRoleDraft | ( | APIRoleDraft | $roleDraft | ) |

Deletes the given RoleDraft.

Since
  6.0

Exceptions

Definition at line 460 of file Core/Repository/RoleService.php.

References eZ\Publish\Core\Repository\RoleService\loadRoleDraft(), and eZ\Publish\API\Repository\Values\User\Role\STATUS_DRAFT.

## ◆ getLimitationType()

eZ\Publish\Core\Repository\RoleService::getLimitationType | ( |  | $identifier | ) |

Returns the LimitationType registered with the given identifier.

Returns the correct implementation of API Limitation value object based on provided identifier

Parameters

  string | $identifier |

Returns
  \eZ\Publish\SPI\Limitation\Type

Exceptions

Implements eZ\Publish\API\Repository\RoleService.

Definition at line 1283 of file Core/Repository/RoleService.php.

## ◆ getLimitationTypesByModuleFunction()

eZ\Publish\Core\Repository\RoleService::getLimitationTypesByModuleFunction | ( |  | $module,
|  |  | $function
| ) |  |

Returns the LimitationType's assigned to a given module/function.

Typically used for:

- Internal validation limitation value use on Policies
- Role admin gui for editing policy limitations incl list limitation options via valueSchema()

Parameters

  string | $module | Legacy name of "controller", it's a unique identifier like "content"
  string | $function | Legacy name of a controller "action", it's a unique within the controller like "read"

Returns
  \eZ\Publish\SPI\Limitation\Type[]

Exceptions

Implements eZ\Publish\API\Repository\RoleService.

Definition at line 1303 of file Core/Repository/RoleService.php.

## ◆ getRoleAssignments()

eZ\Publish\Core\Repository\RoleService::getRoleAssignments | ( | APIRole | $role | ) |

Returns the assigned user and user groups to this role.

Exceptions

Definition at line 1115 of file Core/Repository/RoleService.php.

## ◆ getRoleAssignmentsForUser()

eZ\Publish\Core\Repository\RoleService::getRoleAssignmentsForUser | ( | User | $user,
|  |  | $inherited = `false`
| ) |  |

See also
  \eZ\Publish\API\Repository\RoleService::getRoleAssignmentsForUser()

Implements eZ\Publish\API\Repository\RoleService.

Definition at line 1155 of file Core/Repository/RoleService.php.

References eZ\Publish\Core\Repository\RoleService\loadRole().

## ◆ getRoleAssignmentsForUserGroup()

eZ\Publish\Core\Repository\RoleService::getRoleAssignmentsForUserGroup | ( | UserGroup | $userGroup | ) |

Returns the roles assigned to the given user group, excluding the ones the current user is not allowed to read.

Parameters

  \eZ\Publish\API\Repository\Values\User\UserGroup | $userGroup |

Returns
  \eZ\Publish\API\Repository\Values\User\UserGroupRoleAssignment[]

Implements eZ\Publish\API\Repository\RoleService.

Definition at line 1192 of file Core/Repository/RoleService.php.

References eZ\Publish\Core\Repository\RoleService\loadRole().

## ◆ internalDeletePolicy()

eZ\Publish\Core\Repository\RoleService::internalDeletePolicy | ( | APIPolicy | $policy | ) |
| protected

Deletes a policy.

Used by removePolicy() and deletePolicy()

Parameters

  APIPolicy | $policy |

Exceptions

Definition at line 662 of file Core/Repository/RoleService.php.

Referenced by eZ\Publish\Core\Repository\RoleService\deletePolicy(), and eZ\Publish\Core\Repository\RoleService\removePolicyByRoleDraft().

## ◆ loadPoliciesByUserId()

eZ\Publish\Core\Repository\RoleService::loadPoliciesByUserId | ( |  | $userId | ) |

Loads all policies from roles which are assigned to a user or to user groups to which the user belongs.

Exceptions

Implements eZ\Publish\API\Repository\RoleService.

Definition at line 840 of file Core/Repository/RoleService.php.

## ◆ loadRole()

eZ\Publish\Core\Repository\RoleService::loadRole | ( |  | $id | ) |

Loads a role for the given id.

Exceptions

Implements eZ\Publish\API\Repository\RoleService.

Definition at line 742 of file Core/Repository/RoleService.php.

Referenced by eZ\Publish\Core\Repository\RoleService\addPolicy(), eZ\Publish\Core\Repository\RoleService\deleteRole(), eZ\Publish\Core\Repository\RoleService\getRoleAssignmentsForUser(), eZ\Publish\Core\Repository\RoleService\getRoleAssignmentsForUserGroup(), eZ\Publish\Core\Repository\RoleService\loadRoleAssignment(), and eZ\Publish\Core\Repository\RoleService\updateRole().

## ◆ loadRoleAssignment()

eZ\Publish\Core\Repository\RoleService::loadRoleAssignment | ( |  | $roleAssignmentId | ) |

Loads a role assignment for the given id.

Exceptions

Implements eZ\Publish\API\Repository\RoleService.

Definition at line 1069 of file Core/Repository/RoleService.php.

References eZ\Publish\Core\Repository\RoleService\loadRole().

## ◆ loadRoleByIdentifier()

eZ\Publish\Core\Repository\RoleService::loadRoleByIdentifier | ( |  | $identifier | ) |

Loads a role for the given identifier.

Exceptions

Implements eZ\Publish\API\Repository\RoleService.

Definition at line 765 of file Core/Repository/RoleService.php.

Referenced by eZ\Publish\Core\Repository\RoleService\createRole(), and eZ\Publish\Core\Repository\RoleService\updateRole().

## ◆ loadRoleDraft()

eZ\Publish\Core\Repository\RoleService::loadRoleDraft | ( |  | $id | ) |

Loads a RoleDraft for the given id.

Since
  6.0

Exceptions

Implements eZ\Publish\API\Repository\RoleService.

Definition at line 194 of file Core/Repository/RoleService.php.

References eZ\Publish\API\Repository\Values\User\Role\STATUS_DRAFT.

Referenced by eZ\Publish\Core\Repository\RoleService\addPolicyByRoleDraft(), eZ\Publish\Core\Repository\RoleService\deleteRoleDraft(), eZ\Publish\Core\Repository\RoleService\publishRoleDraft(), eZ\Publish\Core\Repository\RoleService\removePolicyByRoleDraft(), and eZ\Publish\Core\Repository\RoleService\updateRoleDraft().

## ◆ loadRoleDraftByRoleId()

eZ\Publish\Core\Repository\RoleService::loadRoleDraftByRoleId | ( |  | $roleId | ) |

Loads a RoleDraft by the ID of the role it was created from.

Parameters

  mixed | $roleId | ID of the role the draft was created from.

Exceptions

Implements eZ\Publish\API\Repository\RoleService.

Definition at line 217 of file Core/Repository/RoleService.php.

## ◆ loadRoles()

eZ\Publish\Core\Repository\RoleService::loadRoles | ( |  | ) |

Loads all roles, excluding the ones the current user is not allowed to read.

Returns
  \eZ\Publish\API\Repository\Values\User\Role[]

Implements eZ\Publish\API\Repository\RoleService.

Definition at line 787 of file Core/Repository/RoleService.php.

## ◆ newPolicyCreateStruct()

eZ\Publish\Core\Repository\RoleService::newPolicyCreateStruct | ( |  | $module,
|  |  | $function
| ) |  |

Instantiates a policy create class.

Parameters

  string | $module |
  string | $function |

Returns
  \eZ\Publish\API\Repository\Values\User\PolicyCreateStruct

Implements eZ\Publish\API\Repository\RoleService.

Definition at line 1236 of file Core/Repository/RoleService.php.

## ◆ newPolicyUpdateStruct()

eZ\Publish\Core\Repository\RoleService::newPolicyUpdateStruct | ( |  | ) |

Instantiates a policy update class.

Returns
  \eZ\Publish\API\Repository\Values\User\PolicyUpdateStruct

Implements eZ\Publish\API\Repository\RoleService.

Definition at line 1252 of file Core/Repository/RoleService.php.

## ◆ newRoleCreateStruct()

eZ\Publish\Core\Repository\RoleService::newRoleCreateStruct | ( |  | $name | ) |

Instantiates a role create class.

Parameters

  string | $name |

Returns
  \eZ\Publish\API\Repository\Values\User\RoleCreateStruct

Implements eZ\Publish\API\Repository\RoleService.

Definition at line 1218 of file Core/Repository/RoleService.php.

## ◆ newRoleUpdateStruct()

eZ\Publish\Core\Repository\RoleService::newRoleUpdateStruct | ( |  | ) |

Instantiates a policy update class.

Returns
  \eZ\Publish\API\Repository\Values\User\RoleUpdateStruct

Implements eZ\Publish\API\Repository\RoleService.

Definition at line 1266 of file Core/Repository/RoleService.php.

## ◆ publishRoleDraft()

eZ\Publish\Core\Repository\RoleService::publishRoleDraft | ( | APIRoleDraft | $roleDraft | ) |

Publishes a given RoleDraft.

Since
  6.0

Exceptions

Definition at line 484 of file Core/Repository/RoleService.php.

References eZ\Publish\Core\Repository\RoleService\loadRoleDraft().

## ◆ removePolicyByRoleDraft()

eZ\Publish\Core\Repository\RoleService::removePolicyByRoleDraft | ( | APIRoleDraft | $roleDraft,
|  | PolicyDraft | $policyDraft
| ) |  |

Removes a policy from a RoleDraft.

Since
  6.0

Exceptions

Definition at line 370 of file Core/Repository/RoleService.php.

References eZ\Publish\Core\Repository\RoleService\internalDeletePolicy(), and eZ\Publish\Core\Repository\RoleService\loadRoleDraft().

## ◆ removeRoleAssignment()

eZ\Publish\Core\Repository\RoleService::removeRoleAssignment | ( | RoleAssignment | $roleAssignment | ) |

Removes the given role assignment.

Exceptions

Implements eZ\Publish\API\Repository\RoleService.

Definition at line 1041 of file Core/Repository/RoleService.php.

## ◆ unassignRoleFromUser()

eZ\Publish\Core\Repository\RoleService::unassignRoleFromUser | ( | APIRole | $role,
|  | User | $user
| ) |  |

removes a role from the given user.

Exceptions

Definition at line 1002 of file Core/Repository/RoleService.php.

## ◆ unassignRoleFromUserGroup()

eZ\Publish\Core\Repository\RoleService::unassignRoleFromUserGroup | ( | APIRole | $role,
|  | UserGroup | $userGroup
| ) |  |

removes a role from the given user group.

Exceptions

Definition at line 913 of file Core/Repository/RoleService.php.

## ◆ updatePolicy()

eZ\Publish\Core\Repository\RoleService::updatePolicy | ( | APIPolicy | $policy,
|  | APIPolicyUpdateStruct | $policyUpdateStruct
| ) |  |

Updates the limitations of a policy.

The module and function cannot be changed and the limitations are replaced by the ones in $roleUpdateStruct.

Exceptions

Definition at line 688 of file Core/Repository/RoleService.php.

References eZ\Publish\Core\Repository\RoleService\validatePolicy().

## ◆ updatePolicyByRoleDraft()

eZ\Publish\Core\Repository\RoleService::updatePolicyByRoleDraft | ( | APIRoleDraft | $roleDraft,
|  | PolicyDraft | $policy,
|  | APIPolicyUpdateStruct | $policyUpdateStruct
| ) |  |

Updates the limitations of a policy.

The module and function cannot be changed and the limitations are replaced by the ones in $roleUpdateStruct.

Since
  6.0

Exceptions

Definition at line 402 of file Core/Repository/RoleService.php.

References eZ\Publish\Core\Repository\RoleService\validatePolicy().

## ◆ updateRole()

eZ\Publish\Core\Repository\RoleService::updateRole | ( | APIRole | $role,
|  | RoleUpdateStruct | $roleUpdateStruct
| ) |  |

Updates the name of the role.

Deprecated:
  since 6.0, use {

See also
  updateRoleDraft}

Exceptions

Definition at line 523 of file Core/Repository/RoleService.php.

References eZ\Publish\Core\Repository\RoleService\loadRole(), and eZ\Publish\Core\Repository\RoleService\loadRoleByIdentifier().

## ◆ updateRoleDraft()

eZ\Publish\Core\Repository\RoleService::updateRoleDraft | ( | APIRoleDraft | $roleDraft,
|  | RoleUpdateStruct | $roleUpdateStruct
| ) |  |

Updates the properties of a RoleDraft.

Since
  6.0

Exceptions

Definition at line 243 of file Core/Repository/RoleService.php.

References eZ\Publish\Core\Repository\RoleService\loadRoleDraft(), and eZ\Publish\API\Repository\Values\User\Role\STATUS_DRAFT.

## ◆ validatePolicy()

eZ\Publish\Core\Repository\RoleService::validatePolicy | ( |  | $module,
|  |  | $function,
|  | array | $limitations
| ) |  |
| protected

Validates Policy context: Limitations on a module and function.

Exceptions

Definition at line 1364 of file Core/Repository/RoleService.php.

Referenced by eZ\Publish\Core\Repository\RoleService\addPolicy(), eZ\Publish\Core\Repository\RoleService\addPolicyByRoleDraft(), eZ\Publish\Core\Repository\RoleService\updatePolicy(), eZ\Publish\Core\Repository\RoleService\updatePolicyByRoleDraft(), and eZ\Publish\Core\Repository\RoleService\validateRoleCreateStruct().

## ◆ validateRoleCreateStruct()

eZ\Publish\Core\Repository\RoleService::validateRoleCreateStruct | ( | APIRoleCreateStruct | $roleCreateStruct | ) |
| protected

Validates Policies and Limitations in Role create struct.

@uses ::validatePolicy()

Parameters

  \eZ\Publish\API\Repository\Values\User\RoleCreateStruct | $roleCreateStruct |

Returns
  \eZ\Publish\Core\FieldType\ValidationError[][][]

Definition at line 1334 of file Core/Repository/RoleService.php.

References eZ\Publish\Core\Repository\RoleService\validatePolicy().

Referenced by eZ\Publish\Core\Repository\RoleService\createRole().

## Member Data Documentation

## ◆ $limitationService

eZ\Publish\Core\Repository\RoleService::$limitationService
| protected

Definition at line 51 of file Core/Repository/RoleService.php.

Referenced by eZ\Publish\Core\Repository\RoleService\__construct().

## ◆ $permissionResolver

eZ\Publish\Core\Repository\RoleService::$permissionResolver
| private

Definition at line 60 of file Core/Repository/RoleService.php.

## ◆ $repository

eZ\Publish\Core\Repository\RoleService::$repository
| protected

Definition at line 45 of file Core/Repository/RoleService.php.

Referenced by eZ\Publish\Core\Repository\RoleService\__construct().

## ◆ $roleDomainMapper

eZ\Publish\Core\Repository\RoleService::$roleDomainMapper
| protected

Definition at line 54 of file Core/Repository/RoleService.php.

Referenced by eZ\Publish\Core\Repository\RoleService\__construct().

## ◆ $settings

eZ\Publish\Core\Repository\RoleService::$settings
| protected

Definition at line 57 of file Core/Repository/RoleService.php.

Referenced by eZ\Publish\Core\Repository\RoleService\__construct().

## ◆ $userHandler

eZ\Publish\Core\Repository\RoleService::$userHandler
| protected

Definition at line 48 of file Core/Repository/RoleService.php.

Referenced by eZ\Publish\Core\Repository\RoleService\__construct().

The documentation for this class was generated from the following file:

- Core/Repository/RoleService.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.