Copied!

Handler

Handler.php : 14

Storage Engine handler for user module.

Methods

publicaddPolicy()

Handler.php : 284

Adds a policy to a role.

public addPolicy(mixed $roleId, Policy $policy) : Policy

Parameters

Name Type Default value Description
$roleId mixed - -
$policy Policy - -

Return values

Policy

Tags
Throws
InvalidArgumentException

If $policy->limitation is empty (null, empty string/array..)

publicaddPolicyByRoleDraft()

Handler.php : 270

Adds a policy to a role draft.

public addPolicyByRoleDraft(mixed $roleId, Policy $policy) : Policy

Parameters

Name Type Default value Description
$roleId mixed - -
$policy Policy - -

Return values

Policy

Tags
Throws
InvalidArgumentException

If $policy->limitation is empty (null, empty string/array..)

publicassignRole()

Handler.php : 341

Assigns role to a user or user group with given limitations.

public assignRole(mixed $contentId, mixed $roleId[, array<string|int, mixed> $limitation = null ]) : mixed

The limitation array looks like: array( 'Subtree' => array( '/1/2/', '/1/4/', ), 'Foo' => array( 'Bar' ), … )

Where the keys are the limitation identifiers, and the respective values are an array of limitation values. The limitation parameter is optional.

Parameters

Name Type Default value Description
$contentId mixed -

The groupId or userId to assign the role to.

$roleId mixed - -
$limitation array<string|int, mixed> null -

publiccopyRole()

Handler.php : 145

Copies an existing role.

public copyRole(RoleCopyStruct $copyStruct) : Role

Parameters

Name Type Default value Description
$copyStruct RoleCopyStruct - -

Return values

Role

publiccountRoleAssignments()

Handler.php : 221

Counts Role's assignments taking into consideration related and existing user and user group objects.

public countRoleAssignments(int $roleId) : int

Parameters

Name Type Default value Description
$roleId int - -

Return values

int

publiccreate()

Handler.php : 26

Create a user.

public create(User $user) : User

The User struct used to create the user will contain an ID which is used to reference the user.

Parameters

Name Type Default value Description
$user User - -

Return values

User

publiccreateRole()

Handler.php : 127

Create new role.

public createRole(RoleCreateStruct $createStruct) : Role

Parameters

Name Type Default value Description
$createStruct RoleCreateStruct - -

Return values

Role

publiccreateRoleDraft()

Handler.php : 140

Creates a draft of existing defined role.

public createRoleDraft(mixed $roleId) : Role

Sets status to Role::STATUS_DRAFT on the new returned draft.

Parameters

Name Type Default value Description
$roleId mixed - -

Return values

Role

Tags
Throws
NotFoundException

If role with defined status is not found

publicdelete()

Handler.php : 118

Delete user with the given ID.

public delete(mixed $userId) : mixed

Parameters

Name Type Default value Description
$userId mixed - -

publicdeletePolicy()

Handler.php : 305

Removes a policy from a role.

public deletePolicy(mixed $policyId, mixed $roleId) : mixed

Parameters

Name Type Default value Description
$policyId mixed - -
$roleId mixed - -

publicdeleteRole()

Handler.php : 249

Delete the specified role (draft).

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

Parameters

Name Type Default value Description
$roleId mixed - -
$status int Role::STATUS_DEFINED

One of Role::STATUS_DEFINED|Role::STATUS_DRAFT

publicexpireUserToken()

Handler.php : 109

Expires user token with user hash.

public expireUserToken(string $hash) : mixed

Parameters

Name Type Default value Description
$hash string - -

publicload()

Handler.php : 37

Loads user with user ID.

public load(mixed $userId) : User

Parameters

Name Type Default value Description
$userId mixed - -

Return values

User

Tags
Throws
NotFoundException

If user is not found

publicloadByEmail()

Handler.php : 61

Loads user with user email.

public loadByEmail(string $email) : User

Note: This method loads user by $email case in-sensitive on certain storage engines!

Parameters

Name Type Default value Description
$email string - -

Return values

User

publicloadByLogin()

Handler.php : 50

Loads user with user login.

public loadByLogin(string $login) : User

Note: This method loads user by $login case in-sensitive on certain storage engines!

Parameters

Name Type Default value Description
$login string - -

Return values

User

Tags
Throws
NotFoundException

If user is not found

publicloadPoliciesByUserId()

Handler.php : 317

Returns the user policies associated with the user (including inherited policies from user groups).

public loadPoliciesByUserId(mixed $userId) : array<string|int, Policy>

Parameters

Name Type Default value Description
$userId mixed -

In legacy storage engine this is the content object id roles are assigned to in ezuser_role.

Return values

array<string|int, Policy>

Tags
Deprecated

Since 6.8, not currently in use as permission system needs to know about role assignment limitations.

publicloadRole()

Handler.php : 157

Loads a specified role (draft) by $roleId.

public loadRole(mixed $roleId[, int $status = Role::STATUS_DEFINED ]) : Role

Parameters

Name Type Default value Description
$roleId mixed - -
$status int Role::STATUS_DEFINED

One of Role::STATUS_DEFINED|Role::STATUS_DRAFT

Return values

Role

Tags
Throws
NotFoundException

If role is not found

publicloadRoleAssignment()

Handler.php : 198

Loads role assignment for specified assignment ID.

public loadRoleAssignment(mixed $roleAssignmentId) : RoleAssignment

Parameters

Name Type Default value Description
$roleAssignmentId mixed - -

Return values

RoleAssignment

Tags
Throws
NotFoundException

If role assignment is not found

publicloadRoleAssignmentsByGroupId()

Handler.php : 234

Loads roles assignments to a user/group.

public loadRoleAssignmentsByGroupId(mixed $groupId[, bool $inherit = false ]) : array<string|int, RoleAssignment>

Role Assignments with same roleId and limitationIdentifier will be merged together into one.

Parameters

Name Type Default value Description
$groupId mixed -

In legacy storage engine this is the content object id roles are assigned to in ezuser_role. By the nature of legacy this can currently also be used to get by $userId.

$inherit bool false

If true also return inherited role assignments from user groups.

Return values

array<string|int, RoleAssignment>

publicloadRoleAssignmentsByRoleId()

Handler.php : 209

Loads roles assignments Role.

public loadRoleAssignmentsByRoleId(mixed $roleId) : array<string|int, RoleAssignment>

Role Assignments with same roleId and limitationIdentifier will be merged together into one.

Parameters

Name Type Default value Description
$roleId mixed - -

Return values

array<string|int, RoleAssignment>

publicloadRoleAssignmentsByRoleIdWithOffsetAndLimit()

Handler.php : 216

Loads Role's assignments based on provided $offset and $limit arguments.

public loadRoleAssignmentsByRoleIdWithOffsetAndLimit(int $roleId, int $offset, int|null $limit) : array<string|int, RoleAssignment>

Parameters

Name Type Default value Description
$roleId int - -
$offset int - -
$limit int|null - -

Return values

array<string|int, RoleAssignment>

publicloadRoleByIdentifier()

Handler.php : 169

Loads a specified role (draft) by $identifier.

public loadRoleByIdentifier(string $identifier[, int $status = Role::STATUS_DEFINED ]) : Role

Parameters

Name Type Default value Description
$identifier string - -
$status int Role::STATUS_DEFINED

One of Role::STATUS_DEFINED|Role::STATUS_DRAFT

Return values

Role

Tags
Throws
NotFoundException

If role is not found

publicloadRoleDraftByRoleId()

Handler.php : 180

Loads a role draft by the original role ID.

public loadRoleDraftByRoleId(mixed $roleId) : Role

Parameters

Name Type Default value Description
$roleId mixed -

ID of the role the draft was created from.

Return values

Role

Tags
Throws
NotFoundException

If role is not found

publicloadRoles()

Handler.php : 187

Loads all roles.

public loadRoles() : array<string|int, Role>

Return values

array<string|int, Role>

publicloadUserByToken()

Handler.php : 86

Loads user with user hash.

public loadUserByToken(string $hash) : User

Parameters

Name Type Default value Description
$hash string - -

Return values

User

Tags
Throws
NotFoundException

If user is not found

publicloadUsersByEmail()

Handler.php : 75

Loads user(s) with user email.

public loadUsersByEmail(string $email) : array<string|int, User>

As earlier Ibexa versions supported several users having same email (ini config), this function may return several users.

Note: This method loads user by $email case in-sensitive on certain storage engines!

Parameters

Name Type Default value Description
$email string - -

Return values

array<string|int, User>

publicpublishRoleDraft()

Handler.php : 256

Publish the specified role draft.

public publishRoleDraft(mixed $roleDraftId) : mixed

Parameters

Name Type Default value Description
$roleDraftId mixed - -

publicremoveRoleAssignment()

Handler.php : 356

Un-assign a role, by assignment ID.

public removeRoleAssignment(mixed $roleAssignmentId) : mixed

Parameters

Name Type Default value Description
$roleAssignmentId mixed -

The assignment ID.

publicunassignRole()

Handler.php : 349

Un-assign a role.

public unassignRole(mixed $contentId, mixed $roleId) : mixed

Parameters

Name Type Default value Description
$contentId mixed -

The user or user group Id to un-assign the role from.

$roleId mixed - -

publicupdate()

Handler.php : 93

Update the user information specified by the user struct.

public update(User $user) : mixed

Parameters

Name Type Default value Description
$user User - -

publicupdatePassword()

Handler.php : 95
public updatePassword(User $user) : void

Parameters

Name Type Default value Description
$user User - -

publicupdatePolicy()

Handler.php : 295

Update a policy.

public updatePolicy(Policy $policy) : mixed

Replaces limitations values with new values.

Parameters

Name Type Default value Description
$policy Policy - -
Tags
Throws
InvalidArgumentException

If $policy->limitation is empty (null, empty string/array..)

publicupdateRole()

Handler.php : 241

Update role (draft).

public updateRole(RoleUpdateStruct $role) : mixed

Parameters

Name Type Default value Description
$role RoleUpdateStruct - -

publicupdateUserToken()

Handler.php : 102

Update the user information specified by the user token struct.

public updateUserToken(UserTokenUpdateStruct $userTokenUpdateStruct) : mixed

Parameters

Name Type Default value Description
$userTokenUpdateStruct UserTokenUpdateStruct - -