Bitrix API

Permissions

Table of Contents

Constants

ACTION_LISTEN  = 'LISTEN'
ACTION_MODIFY  = 'MODIFY'
ACTION_PERFORM  = 'PERFORM'
ACTION_VIEW  = 'VIEW'
ENTITY_BALANCE  = 'BALANCE'
ENTITY_CALL  = 'CALL'
ENTITY_CALL_DETAIL  = 'CALL_DETAIL'
ENTITY_CALL_RECORD  = 'CALL_RECORD'
ENTITY_LINE  = 'LINE'
ENTITY_SETTINGS  = 'SETTINGS'
ENTITY_USER  = 'USER'
PERMISSION_ANY  = 'X'
PERMISSION_CALL_CRM  = 'C'
PERMISSION_CALL_USERS  = 'K'
PERMISSION_DEPARTMENT  = 'D'
PERMISSION_NONE  = ''
PERMISSION_SELF  = 'A'

Methods

canModifyLines()  : bool
Shortcut method for checking MODIFY permission on ENTITY_LINE
canModifySettings()  : bool
Shortcut method for checking MODIFY permission on ENTITY_SETTINGS
canPerform()  : bool
Returns true if user can perform specified action on the entity.
createWithCurrentUser()  : Permissions
Creates class instance for the current user.
createWithUserId()  : Permissions
Creates class instance for the specified user.
getActionName()  : string
Returns name of the action by its code.
getEntityName()  : string
Returns name of the entity by its code.
getNormalizedPermissions()  : array<string|int, mixed>
Returns normalized permissions array.
getPermission()  : string
Returns permission code according to the user's permissions.
getPermissionName()  : string
Returns name of the permission by its code.
getUserId()  : int
Returns user id.

Constants

ACTION_PERFORM

public mixed ACTION_PERFORM = 'PERFORM'

ENTITY_BALANCE

public mixed ENTITY_BALANCE = 'BALANCE'

ENTITY_CALL_DETAIL

public mixed ENTITY_CALL_DETAIL = 'CALL_DETAIL'

ENTITY_CALL_RECORD

public mixed ENTITY_CALL_RECORD = 'CALL_RECORD'

ENTITY_SETTINGS

public mixed ENTITY_SETTINGS = 'SETTINGS'

PERMISSION_CALL_CRM

public mixed PERMISSION_CALL_CRM = 'C'

PERMISSION_CALL_USERS

public mixed PERMISSION_CALL_USERS = 'K'

PERMISSION_DEPARTMENT

public mixed PERMISSION_DEPARTMENT = 'D'

Methods

canModifyLines()

Shortcut method for checking MODIFY permission on ENTITY_LINE

public canModifyLines() : bool
Return values
bool

canModifySettings()

Shortcut method for checking MODIFY permission on ENTITY_SETTINGS

public canModifySettings() : bool
Return values
bool

canPerform()

Returns true if user can perform specified action on the entity.

public canPerform(string $entityCode, string $actionCode[, string $minimumPermission = null ]) : bool
Parameters
$entityCode : string

Code of the entity.

$actionCode : string

Code of the action.

$minimumPermission : string = null

Permission code.

Tags
throws
ArgumentException
Return values
bool

createWithUserId()

Creates class instance for the specified user.

public static createWithUserId(int $userId) : Permissions
Parameters
$userId : int

User's id.

Return values
Permissions

getActionName()

Returns name of the action by its code.

public static getActionName(string $action) : string
Parameters
$action : string

Action code.

Return values
string

getEntityName()

Returns name of the entity by its code.

public static getEntityName(string $entity) : string
Parameters
$entity : string

Entity code.

Return values
string

getNormalizedPermissions()

Returns normalized permissions array.

public static getNormalizedPermissions(array<string|int, mixed> $permissions) : array<string|int, mixed>
Parameters
$permissions : array<string|int, mixed>

Some not normalized permissions array.

Return values
array<string|int, mixed>

getPermission()

Returns permission code according to the user's permissions.

public getPermission(string $entityCode, string $actionCode) : string
Parameters
$entityCode : string

Code of the entity.

$actionCode : string

Code of the action.

Tags
throws
ArgumentException
Return values
string

getPermissionName()

Returns name of the permission by its code.

public static getPermissionName(string $permission) : string
Parameters
$permission : string

Permission code.

Return values
string

getUserId()

Returns user id.

public getUserId() : int
Return values
int

        
On this page

Search results