RolePermission
Table of Contents
Methods
- getAdminRolesIds() : array<string|int, mixed>
- getAll() : mixed
- getByEntityId() : array<string|int, mixed>
- getPermissionsByRoles() : array<string|int, mixed>
- getSystemRolesIds() : array<string|int, mixed>
- setByEntityId() : Result
- Sets a permission from the set for certain roles but one entity
- setByEntityIdForAllNotAdminRoles() : Result
- Sets the same permission for all roles but one entity
Methods
getAdminRolesIds()
public
static getAdminRolesIds([int|null $entityTypeId = null ]) : array<string|int, mixed>
Parameters
- $entityTypeId : int|null = null
Return values
array<string|int, mixed>getAll()
public
static getAll() : mixed
getByEntityId()
public
static getByEntityId(string $permissionEntityId[, bool $skipSystemRoles = true ]) : array<string|int, mixed>
Parameters
- $permissionEntityId : string
- $skipSystemRoles : bool = true
Return values
array<string|int, mixed> —it is an array like [roleId => ["READ" => ["-" => "X"], ...]]]
getPermissionsByRoles()
public
static getPermissionsByRoles(array<string|int, mixed> $roleIds) : array<string|int, mixed>
Parameters
- $roleIds : array<string|int, mixed>
Return values
array<string|int, mixed>getSystemRolesIds()
public
static getSystemRolesIds() : array<string|int, mixed>
Return values
array<string|int, mixed>setByEntityId()
Sets a permission from the set for certain roles but one entity
public
static setByEntityId(string $permissionEntityId, array<string|int, mixed> $permissionSet[, bool $skipAdminRoles = false ][, mixed $skipSystemRoles = true ]) : Result
Parameters
- $permissionEntityId : string
- $permissionSet : array<string|int, mixed>
-
it is an array like [roleId => ["READ" => ["-" => "X"], ...]]]
- $skipAdminRoles : bool = false
-
Skip roles with "Allow edit config" checkbox to avoid decreasing permissions level in them
- $skipSystemRoles : mixed = true
Return values
ResultsetByEntityIdForAllNotAdminRoles()
Sets the same permission for all roles but one entity
public
static setByEntityIdForAllNotAdminRoles(CategoryIdentifier $categoryIdentifier, array<string|int, mixed> $permissionSet[, bool $needStrictByRoleGroupCode = true ]) : Result
Parameters
- $categoryIdentifier : CategoryIdentifier
- $permissionSet : array<string|int, mixed>
-
it is an array like ["READ" => ["-" => ["ATTR" => "X"]], ...]]
- $needStrictByRoleGroupCode : bool = true