PermissionManager
in package
Service class for managing permission
Table of Contents
Properties
Methods
- __construct() : mixed
- applyPermissions() : bool
- getCurrentPermission() : bool
- get the current permission To be mocked for test
- getDbPermission() : Permission|null
- Get DB permission To be mocked for test
- getNewEvent() : PluginEvent
- getNewPermission() : Permission
- getPermissionData() : array<string|int, mixed>
- get the permission data
- setDbPermission() : Permission
- Set a new DB permission To be mocked for test
- setMinimalEntityPermission() : void
- setPermissions() : bool
Properties
$app
private
LSYii_Application
$app
$model
private
PermissionInterface
$model
model where permission is checked
$request
private
LSHttpRequest
$request
$user
private
LSWebUser
$user
Methods
__construct()
public
__construct(LSHttpRequest $request, LSWebUser $user, PermissionInterface $model, LSYii_Application $app) : mixed
Parameters
- $request : LSHttpRequest
- $user : LSWebUser
- $model : PermissionInterface
- $app : LSYii_Application
applyPermissions()
public
applyPermissions(int $userId, string $sPermission, array<string|int, mixed> $aSetPermission) : bool
Parameters
- $userId : int
- $sPermission : string
- $aSetPermission : array<string|int, mixed>
Return values
boolgetCurrentPermission()
get the current permission To be mocked for test
public
getCurrentPermission(string $sPermission, string $crud, int $userId) : bool
Parameters
- $sPermission : string
- $crud : string
- $userId : int
Return values
boolgetDbPermission()
Get DB permission To be mocked for test
public
getDbPermission(string $entityName, int $entityId, string|int $userId, string $sPermission) : Permission|null
Parameters
- $entityName : string
- $entityId : int
- $userId : string|int
- $sPermission : string
Return values
Permission|nullgetNewEvent()
public
getNewEvent(string $eventName) : PluginEvent
Parameters
- $eventName : string
Return values
PluginEventgetNewPermission()
public
getNewPermission() : Permission
Return values
PermissiongetPermissionData()
get the permission data
public
getPermissionData([int|null $userId = null ]) : array<string|int, mixed>
Parameters
- $userId : int|null = null
-
for this user id
Return values
array<string|int, mixed>setDbPermission()
Set a new DB permission To be mocked for test
public
setDbPermission(string $entityName, int $entityId, int $userId, string $sPermission) : Permission
Parameters
- $entityName : string
- $entityId : int
- $userId : int
- $sPermission : string
Return values
PermissionsetMinimalEntityPermission()
public
setMinimalEntityPermission(int $userId) : void
Parameters
- $userId : int
setPermissions()
public
setPermissions(int $userId) : bool
Parameters
- $userId : int