Role
in package
FinalYes
Table of Contents
Properties
Methods
- __construct() : mixed
- addInheritance() : void
- assignRoleToUser() : void
- create() : int
- delete() : void
- getAll() : array<string|int, mixed>
- getRoleId() : int
- getUserRoles() : array<string|int, mixed>
- removeInheritance() : void
- removeUserRole() : bool
- userHasRole() : bool
Properties
$cache
private
SessionPermissionCache
$cache
$logger
private
Logger
$logger
$mySql
private
MySql
$mySql
Methods
__construct()
public
__construct(MySql $mySql, SessionPermissionCache $cache, Logger $logger) : mixed
Parameters
- $mySql : MySql
- $cache : SessionPermissionCache
- $logger : Logger
addInheritance()
public
addInheritance(string $child, string $parent) : void
Parameters
- $child : string
- $parent : string
Tags
assignRoleToUser()
public
assignRoleToUser(int $userId, string $roleName) : void
Parameters
- $userId : int
- $roleName : string
Tags
create()
public
create(string $roleName, string $roleDescription) : int
Parameters
- $roleName : string
- $roleDescription : string
Tags
Return values
intdelete()
public
delete(string $roleName) : void
Parameters
- $roleName : string
Tags
getAll()
public
getAll() : array<string|int, mixed>
Return values
array<string|int, mixed>getRoleId()
public
getRoleId(string $roleName) : int
Parameters
- $roleName : string
Tags
Return values
intgetUserRoles()
public
getUserRoles(int $userId) : array<string|int, mixed>
Parameters
- $userId : int
Return values
array<string|int, mixed>removeInheritance()
public
removeInheritance(string $child, string $parent) : void
Parameters
- $child : string
- $parent : string
removeUserRole()
public
removeUserRole(int $userId, string $role) : bool
Parameters
- $userId : int
- $role : string
Return values
booluserHasRole()
public
userHasRole(int $userId, string $roleName) : bool
Parameters
- $userId : int
- $roleName : string