jAcl2
in package
Main class to query the acl system, and to know value of a right.
you should call this class (all method are static) when you want to know if the current user have a right
Tags
Table of Contents
- $driver : null|jIAcl2Driver|jIAcl2Driver2
- check() : bool
- call this method to know if the current user has the right with the given value.
- checkByUser() : bool
- call this method to know if the given user has the right with the given value.
- clearCache() : mixed
- clear right cache.
- unloadDriver() : mixed
- for tests.
- _getDriver() : jIAcl2Driver|jIAcl2Driver2
- load the acl2 driver.
Properties
$driver
protected
static null|jIAcl2Driver|jIAcl2Driver2
$driver
Tags
Methods
check()
call this method to know if the current user has the right with the given value.
public
static check(string $right[, string $resource = null ]) : bool
Parameters
- $right : string
-
the key of the right to check
- $resource : string = null
-
the id of a resource
Tags
Return values
bool —true if yes
checkByUser()
call this method to know if the given user has the right with the given value.
public
static checkByUser(string $login, string $subject[, string $resource = null ]) : bool
Parameters
- $login : string
-
the user login. Can be empty/null if anonymous
- $subject : string
-
the key of the subject to check
- $resource : string = null
-
the id of a resource
Tags
Return values
bool —true if yes
clearCache()
clear right cache.
public
static clearCache() : mixed
Tags
Return values
mixed —unloadDriver()
for tests.
public
static unloadDriver() : mixed
..
Tags
Return values
mixed —_getDriver()
load the acl2 driver.
protected
static _getDriver() : jIAcl2Driver|jIAcl2Driver2