Permission
in package
FinalYes
Table of Contents
Properties
- $action : Action
- $cache : SessionPermissionCache
- $logger : Logger
- $mySql : MySql
- $resource : Resource
- $role : Role
Methods
- __construct() : mixed
- getPermissionId() : int
- grantRolePermission() : void
- grantUserPermission() : void
- revokeRolePermission() : bool
- revokeUserPermission() : bool
- ensurePermission() : int
Properties
$action
private
Action
$action
$cache
private
SessionPermissionCache
$cache
$logger
private
Logger
$logger
$mySql
private
MySql
$mySql
$resource
private
Resource
$resource
$role
private
Role
$role
Methods
__construct()
public
__construct(MySql $mySql, Role $role, resource $resource, Action $action, Logger $logger, SessionPermissionCache $cache) : mixed
Parameters
- $mySql : MySql
- $role : Role
- $resource : resource
- $action : Action
- $logger : Logger
- $cache : SessionPermissionCache
getPermissionId()
public
getPermissionId(string $resource, string $action) : int
Parameters
- $resource : string
- $action : string
Tags
Return values
intgrantRolePermission()
public
grantRolePermission(string $roleName, string $resource, string $action, bool $allow) : void
Parameters
- $roleName : string
- $resource : string
- $action : string
- $allow : bool
grantUserPermission()
public
grantUserPermission(int $userId, string $resource, string $action, bool $allow) : void
Parameters
- $userId : int
- $resource : string
- $action : string
- $allow : bool
revokeRolePermission()
public
revokeRolePermission(string $roleName, string $resource, string $action) : bool
Parameters
- $roleName : string
- $resource : string
- $action : string
Return values
boolrevokeUserPermission()
public
revokeUserPermission(int $userId, string $resource, string $action) : bool
Parameters
- $userId : int
- $resource : string
- $action : string
Return values
boolensurePermission()
private
ensurePermission(string $resource, string $action) : int
Parameters
- $resource : string
- $action : string