Class

eZ\Publish\Core\Persistence\Legacy\User\Role\Gateway

abstract class Gateway

Base class for content type gateways.

Methods

Role createRole(Role $role)

Create new role.

array loadRole(mixed $roleId, int $status = Role::STATUS_DEFINED)

Loads a specified role by $roleId.

array loadRoleByIdentifier(string $identifier, int $status = Role::STATUS_DEFINED)

Loads a specified role by $identifier.

array loadRoleDraftByRoleId(mixed $roleId)

Loads a role draft by the original role ID.

array loadRoles(int $status = Role::STATUS_DEFINED)

Loads all roles.

array loadRolesForContentObjects(array $contentIds, int $status = Role::STATUS_DEFINED)

Loads all roles associated with the given content objects.

array loadRoleAssignment(mixed $roleAssignmentId)

Loads role assignment for specified assignment ID.

array loadRoleAssignmentsByGroupId(mixed $groupId, bool $inherited = false)

Loads role assignments for specified content ID.

array loadRoleAssignmentsByRoleId(mixed $roleId)

Loads role assignments for given role ID.

UserPolicy[] loadPoliciesByUserId(mixed $userId)

Returns the user policies associated with the user.

updateRole(RoleUpdateStruct $role)

Update role (draft).

deleteRole(mixed $roleId, int $status = Role::STATUS_DEFINED)

Delete the specified role (draft).

publishRoleDraft(mixed $roleDraftId, mixed|null $originalRoleId = null)

Publish the specified role draft.

addPolicy(mixed $roleId, Policy $policy)

Adds a policy to a role.

addPolicyLimitations(int $policyId, array $limitations)

Adds limitations to an existing policy.

removePolicy(mixed $policyId)

Removes a policy from a role.

removePolicyLimitations(mixed $policyId)

Removes a policy from a role.

Details

at line 27
abstract public Role createRole(Role $role)

Create new role.

Parameters

Role $role

Return Value

Role

at line 37
abstract public array loadRole(mixed $roleId, int $status = Role::STATUS_DEFINED)

Loads a specified role by $roleId.

Parameters

mixed $roleId
int $status One of Role::STATUSDEFINED|Role::STATUSDRAFT

Return Value

array

at line 47
abstract public array loadRoleByIdentifier(string $identifier, int $status = Role::STATUS_DEFINED)

Loads a specified role by $identifier.

Parameters

string $identifier
int $status One of Role::STATUSDEFINED|Role::STATUSDRAFT

Return Value

array

at line 56
abstract public array loadRoleDraftByRoleId(mixed $roleId)

Loads a role draft by the original role ID.

Parameters

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

Return Value

array

at line 65
abstract public array loadRoles(int $status = Role::STATUS_DEFINED)

Loads all roles.

Parameters

int $status One of Role::STATUSDEFINED|Role::STATUSDRAFT

Return Value

array

at line 75
abstract public array loadRolesForContentObjects(array $contentIds, int $status = Role::STATUS_DEFINED)

Loads all roles associated with the given content objects.

Parameters

array $contentIds
int $status One of Role::STATUSDEFINED|Role::STATUSDRAFT

Return Value

array

at line 84
abstract public array loadRoleAssignment(mixed $roleAssignmentId)

Loads role assignment for specified assignment ID.

Parameters

mixed $roleAssignmentId

Return Value

array

at line 94
abstract public array loadRoleAssignmentsByGroupId(mixed $groupId, bool $inherited = false)

Loads role assignments for specified content ID.

Parameters

mixed $groupId
bool $inherited

Return Value

array

at line 103
abstract public array loadRoleAssignmentsByRoleId(mixed $roleId)

Loads role assignments for given role ID.

Parameters

mixed $roleId

Return Value

array

at line 112
abstract public UserPolicy[] loadPoliciesByUserId(mixed $userId)

Returns the user policies associated with the user.

Parameters

mixed $userId

Return Value

UserPolicy[]

at line 121
abstract public updateRole(RoleUpdateStruct $role)

Update role (draft).

Will not throw anything if location id is invalid.

Parameters

RoleUpdateStruct $role

at line 130
abstract public deleteRole(mixed $roleId, int $status = Role::STATUS_DEFINED)

Delete the specified role (draft).

If it's not a draft, the role assignments will also be deleted.

Parameters

mixed $roleId
int $status One of Role::STATUSDEFINED|Role::STATUSDRAFT

at line 139
abstract public publishRoleDraft(mixed $roleDraftId, mixed|null $originalRoleId = null)

Publish the specified role draft.

If the draft was created from an existing role, published version will take the original role ID.

Parameters

mixed $roleDraftId
mixed|null $originalRoleId ID of role the draft was created from. Will be null if the role draft was completely new.

at line 147
abstract public addPolicy(mixed $roleId, Policy $policy)

Adds a policy to a role.

Parameters

mixed $roleId
Policy $policy

at line 155
abstract public addPolicyLimitations(int $policyId, array $limitations)

Adds limitations to an existing policy.

Parameters

int $policyId
array $limitations

at line 162
abstract public removePolicy(mixed $policyId)

Removes a policy from a role.

Parameters

mixed $policyId

at line 169
abstract public removePolicyLimitations(mixed $policyId)

Removes a policy from a role.

Parameters

mixed $policyId