PHP 클래스 Acl\Adapter\Utility\PhpAro

파일 보기 프로젝트 열기: cakephp/acl 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$aliases array aliases to map
$map array ['Users' => ['username' => 'jeff', 'role' => 'editor']] is passed as an ARO to one of the methods of AclComponent, PhpAcl will check if it can be resolved to an User or a Role defined in the configuration file.

보호된 프로퍼티들

프로퍼티 타입 설명
$_tree array internal ARO representation

공개 메소드들

메소드 설명
__construct ( array $aro = [], array $map = [], array $aliases = [] ) Constructor
addAlias ( array $alias ) : void adds one or more aliases to the internal map. Overwrites existing entries.
addRole ( array $aro ) : void adds a new ARO to the tree
build ( array $aros ) : void build an ARO tree structure for internal processing
resolve ( string | array $aro ) : string resolve an ARO identifier to an internal ARO string using the internal mapping information.
roles ( string | array $aro ) : array From the perspective of the given ARO, walk down the tree and collect all inherited AROs levelwise such that AROs from different branches with equal distance to the requested ARO will be collected at the same index. The resulting array will contain a prioritized list of (list of) roles ordered from the most distant AROs to the requested one itself.

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( array $aro = [], array $map = [], array $aliases = [] )
$aro array Aro instance
$map array Map
$aliases array Aliases

addAlias() 공개 메소드

adds one or more aliases to the internal map. Overwrites existing entries.
public addAlias ( array $alias ) : void
$alias array alias from => to (e.g. Role/13 -> Role/editor)
리턴 void

addRole() 공개 메소드

adds a new ARO to the tree
public addRole ( array $aro ) : void
$aro array one or more ARO records
리턴 void

build() 공개 메소드

build an ARO tree structure for internal processing
public build ( array $aros ) : void
$aros array array of AROs as key and their inherited AROs as values
리턴 void

resolve() 공개 메소드

resolve an ARO identifier to an internal ARO string using the internal mapping information.
public resolve ( string | array $aro ) : string
$aro string | array ARO identifier (Users.jeff, ['Users' => ...], etc)
리턴 string internal aro string (e.g. Users/jeff, Role/default)

roles() 공개 메소드

From the perspective of the given ARO, walk down the tree and collect all inherited AROs levelwise such that AROs from different branches with equal distance to the requested ARO will be collected at the same index. The resulting array will contain a prioritized list of (list of) roles ordered from the most distant AROs to the requested one itself.
public roles ( string | array $aro ) : array
$aro string | array An ARO identifier
리턴 array prioritized AROs

프로퍼티 상세

$_tree 보호되어 있는 프로퍼티

internal ARO representation
protected array $_tree
리턴 array

$aliases 공개적으로 프로퍼티

aliases to map
public array $aliases
리턴 array

$map 공개적으로 프로퍼티

['Users' => ['username' => 'jeff', 'role' => 'editor']] is passed as an ARO to one of the methods of AclComponent, PhpAcl will check if it can be resolved to an User or a Role defined in the configuration file.
public array $map
리턴 array