PHP Класс li3_access\extensions\adapter\security\access\AuthRbac

Наследование: extends lithium\core\Object
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$_autoConfig array
$_roles mixed null if unset array otherwise with fetched AuthObjects

Открытые методы

Метод Описание
check ( mixed $requester, mixed $params, array $options = [] ) : Array The Rbac adapter will iterate through the rbac data Array.
parseMatch ( mixed $match, mixed $params ) : boolean parseMatch Matches the current request parameters against a set of given parameters.

Защищенные методы

Метод Описание
_accessable ( $resources, $roles, array $options = [] ) : void _hasRole Compares the results from _getRolesByAuth with the array passed to it.
_getRolesByAuth ( mixed $params, array $options = [] ) : array | mixed
_hasRole ( $requesters, $params, array $options = [] )
_isAccessible ( array &$role, $params, array $options ) : boolean Checks if the Role grants access If allow === false => no access If requesters has no role => no access If allows contains closures => return closures return Otherwise => grants access
_parseClosures ( array &$data, object $request, array &$roleOptions = [] ) : boolean _parseClosures Iterates over an array and runs any anonymous functions it finds. Returns true if all of the closures it runs evaluate to true. $match is passed by refference and any closures found are removed from it before the method is complete.
_run ( array &$data, mixed $request = null, array &$options = [] ) : void Itterates over an array and runs any anonymous functions it finds. Returns true if all of the closures it runs evaluate to true. $match is passed by reference and any closures found are removed from it before the method is complete.

Описание методов

_accessable() защищенный Метод

_hasRole Compares the results from _getRolesByAuth with the array passed to it.
protected _accessable ( $resources, $roles, array $options = [] ) : void
$options array
Результат void

_getRolesByAuth() защищенный статический Метод

protected static _getRolesByAuth ( mixed $params, array $options = [] ) : array | mixed
$params mixed The Lithium `Request` object, or an array with at least 'request', and 'params'
$options array
Результат array | mixed $roles Roles with attached User Models

_hasRole() защищенный статический Метод

protected static _hasRole ( $requesters, $params, array $options = [] )
$options array

_isAccessible() защищенный статический Метод

Checks if the Role grants access If allow === false => no access If requesters has no role => no access If allows contains closures => return closures return Otherwise => grants access
protected static _isAccessible ( array &$role, $params, array $options ) : boolean
$role array Array Set of Roles (dereferenced)
$options array An array of additional options for the _getRolesByAuth method.
Результат boolean $accessable

_parseClosures() защищенный статический Метод

_parseClosures Iterates over an array and runs any anonymous functions it finds. Returns true if all of the closures it runs evaluate to true. $match is passed by refference and any closures found are removed from it before the method is complete.
protected static _parseClosures ( array &$data, object $request, array &$roleOptions = [] ) : boolean
$data array dereferenced Array
$request object The Lithium `Request` object
$roleOptions array dereferenced Array
Результат boolean

_run() защищенный Метод

Itterates over an array and runs any anonymous functions it finds. Returns true if all of the closures it runs evaluate to true. $match is passed by reference and any closures found are removed from it before the method is complete.
protected _run ( array &$data, mixed $request = null, array &$options = [] ) : void
$data array
$request mixed
$options array
Результат void

check() публичный Метод

The Rbac adapter will iterate through the rbac data Array.
public check ( mixed $requester, mixed $params, array $options = [] ) : Array
$requester mixed The user data array that holds all necessary information about the user requesting access. Or false (because Auth::check() can return false). This is an optional parameter, because we will fetch the users data through Auth seperately.
$params mixed The Lithium `Request` object, or an array with at least 'request', and 'params'
$options array An array of additional options for the _getRolesByAuth method.
Результат Array An empty array if access is allowed or an array with reasons for denial if denied.

parseMatch() публичный статический Метод

Can match against a shorthand string (Controller::action) or a full array. If a parameter is provided then it must have an equivilent in the Request objects parmeters in order to validate. * Is also acceptable to match a parameter without a specific value.
public static parseMatch ( mixed $match, mixed $params ) : boolean
$match mixed A set of parameters to validate the request against.
$params mixed The Lithium `Request` object, or an array with at least 'request', and 'params'
Результат boolean True if a match is found.

Описание свойств

$_autoConfig защищенное свойство

См. также: lithium\core\Object::$_autoConfig
protected array $_autoConfig
Результат array

$_roles защищенное свойство

null if unset array otherwise with fetched AuthObjects
protected mixed $_roles
Результат mixed