Permissions
Table of Contents
Constants
- ACTION_MODIFY = 'MODIFY'
- ACTION_PERFORM = 'PERFORM'
- ACTION_VIEW = 'VIEW'
- ENTITY_CONNECTORS = 'CONNECTORS'
- ENTITY_HISTORY = 'HISTORY'
- ENTITY_JOIN = 'JOIN'
- ENTITY_LINES = 'LINES'
- ENTITY_QUICK_ANSWERS = 'QUICK_ANSWERS'
- ENTITY_SESSION = 'SESSION'
- ENTITY_SETTINGS = 'SETTINGS'
- ENTITY_SOFT_PAUSE_LIST = 'SOFT_PAUSE_LIST'
- ENTITY_VOTE_HEAD = 'VOTE_HEAD'
- PERMISSION_ALLOW = 'X'
- PERMISSION_ANY = 'X'
- PERMISSION_DEPARTMENT = 'D'
- PERMISSION_NONE = ''
- PERMISSION_SELF = 'A'
Methods
- canModifyConnectors() : bool
- Shortcut method for checking MODIFY permission on ENTITY_CONNECTORS
- canModifyLines() : bool
- Shortcut method for checking MODIFY permission on ENTITY_LINES
- canModifySettings() : bool
- Shortcut method for checking MODIFY permission on ENTITY_SETTINGS
- canPerform() : bool
- Returns true if user can perform specified action on the entity.
- canViewLines() : bool
- Shortcut method for checking MODIFY permission on ENTITY_LINES
- canViewStatistics() : bool
- Shortcut method for checking MODIFY permission on ENTITY_LINES
- 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_MODIFY
public
mixed
ACTION_MODIFY
= 'MODIFY'
ACTION_PERFORM
public
mixed
ACTION_PERFORM
= 'PERFORM'
ACTION_VIEW
public
mixed
ACTION_VIEW
= 'VIEW'
ENTITY_CONNECTORS
public
mixed
ENTITY_CONNECTORS
= 'CONNECTORS'
ENTITY_HISTORY
public
mixed
ENTITY_HISTORY
= 'HISTORY'
ENTITY_JOIN
public
mixed
ENTITY_JOIN
= 'JOIN'
ENTITY_LINES
public
mixed
ENTITY_LINES
= 'LINES'
ENTITY_QUICK_ANSWERS
public
mixed
ENTITY_QUICK_ANSWERS
= 'QUICK_ANSWERS'
ENTITY_SESSION
public
mixed
ENTITY_SESSION
= 'SESSION'
ENTITY_SETTINGS
public
mixed
ENTITY_SETTINGS
= 'SETTINGS'
ENTITY_SOFT_PAUSE_LIST
public
mixed
ENTITY_SOFT_PAUSE_LIST
= 'SOFT_PAUSE_LIST'
ENTITY_VOTE_HEAD
public
mixed
ENTITY_VOTE_HEAD
= 'VOTE_HEAD'
PERMISSION_ALLOW
public
mixed
PERMISSION_ALLOW
= 'X'
PERMISSION_ANY
public
mixed
PERMISSION_ANY
= 'X'
PERMISSION_DEPARTMENT
public
mixed
PERMISSION_DEPARTMENT
= 'D'
PERMISSION_NONE
public
mixed
PERMISSION_NONE
= ''
PERMISSION_SELF
public
mixed
PERMISSION_SELF
= 'A'
Methods
canModifyConnectors()
Shortcut method for checking MODIFY permission on ENTITY_CONNECTORS
public
canModifyConnectors() : bool
Return values
boolcanModifyLines()
Shortcut method for checking MODIFY permission on ENTITY_LINES
public
canModifyLines() : bool
Return values
boolcanModifySettings()
Shortcut method for checking MODIFY permission on ENTITY_SETTINGS
public
canModifySettings() : bool
Return values
boolcanPerform()
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
Return values
boolcanViewLines()
Shortcut method for checking MODIFY permission on ENTITY_LINES
public
canViewLines() : bool
Return values
boolcanViewStatistics()
Shortcut method for checking MODIFY permission on ENTITY_LINES
public
canViewStatistics() : bool
Return values
boolcreateWithCurrentUser()
Creates class instance for the current user.
public
static createWithCurrentUser() : Permissions
Return values
PermissionscreateWithUserId()
Creates class instance for the specified user.
public
static createWithUserId(int $userId) : Permissions
Parameters
- $userId : int
-
User's id.
Return values
PermissionsgetActionName()
Returns name of the action by its code.
public
static getActionName(string $action) : string
Parameters
- $action : string
-
Action code.
Return values
stringgetEntityName()
Returns name of the entity by its code.
public
static getEntityName(string $entity) : string
Parameters
- $entity : string
-
Entity code.
Return values
stringgetNormalizedPermissions()
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
Return values
stringgetPermissionName()
Returns name of the permission by its code.
public
static getPermissionName(string $permission) : string
Parameters
- $permission : string
-
Permission code.
Return values
stringgetUserId()
Returns user id.
public
getUserId() : int