PHP 클래스 li3_access\extensions\adapter\security\access\AuthRbac

상속: extends lithium\core\Object
파일 보기 프로젝트 열기: tmaiaroto/li3_access

보호된 프로퍼티들

프로퍼티 타입 설명
$_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