PermissionTrait
Table of Contents
Methods
- getMinimalPermissionRead() : null|string
- Get minimal permission name (for read value)
- getOwnerId() : int|null
- Get the owner id of this record Used for Permission, to be extendable for each model with owner
- getPermissionData() : array<string|int, mixed>
- Get Permission data for Permission object
- hasPermission() : bool
- Get the permission of current model
Methods
getMinimalPermissionRead()
Get minimal permission name (for read value)
public
static getMinimalPermissionRead() : null|string
Return values
null|stringgetOwnerId()
Get the owner id of this record Used for Permission, to be extendable for each model with owner
public
getOwnerId() : int|null
Return values
int|nullgetPermissionData()
Get Permission data for Permission object
public
static getPermissionData() : array<string|int, mixed>
Return values
array<string|int, mixed>hasPermission()
Get the permission of current model
public
hasPermission(string $sPermission[, string $sCRUD = 'read' ][, int $iUserID = null ]) : bool
Parameters
- $sPermission : string
-
Name of the permission
- $sCRUD : string = 'read'
-
The permission detail you want to check on: 'create','read','update','delete','import' or 'export'
- $iUserID : int = null
-
User ID - if not given the one of the current user is used