EntityPermissionsRelation
Entity permissions relation
Table of Contents
Methods
- getPermission() : Model|null
- Get permission model
- getPublicPermission() : Model|false
- Get public entity permission
- hasAccess() : bool
- Return true if user have access
- hasPermissions() : bool
- Return true if model have permissions
- isPublic() : bool
- Return true if item is public
- permissions() : hasMany
- Entity permisisons relation
Methods
getPermission()
Get permission model
public
getPermission(int $userId[, string $type = 'user' ]) : Model|null
Parameters
- $userId : int
- $type : string = 'user'
Return values
Model|nullgetPublicPermission()
Get public entity permission
public
getPublicPermission([int|null $entityId = null ]) : Model|false
Parameters
- $entityId : int|null = null
Return values
Model|falsehasAccess()
Return true if user have access
public
hasAccess(int $userId, string|array<string|int, mixed> $access[, string|null $type = 'user' ][, int|null $typeId = null ]) : bool
Parameters
- $userId : int
- $access : string|array<string|int, mixed>
- $type : string|null = 'user'
- $typeId : int|null = null
Return values
boolhasPermissions()
Return true if model have permissions
public
hasPermissions() : bool
Return values
boolisPublic()
Return true if item is public
public
isPublic([int|null $entityId = null ]) : bool
Parameters
- $entityId : int|null = null
Return values
boolpermissions()
Entity permisisons relation
public
permissions() : hasMany