PHP Трейт TinyAuth\Auth\AclTrait

Показать файл Открыть проект

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

Свойство Тип Описание
$_acl array | null
$_roles array | null

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

Метод Описание
_check ( array $user, array $params ) : boolean Checks the URL to the role(s).
_constructIniKey ( array $params ) : string Constructs an ACL INI section key from a given Request.
_deconstructIniKey ( string $key ) : array Deconstructs an ACL INI section key into a named array with ACL parts.
_defaultConfig ( ) : array
_getAcl ( string | array | null $path = null ) : array Parses INI file and returns the allowed roles per action.
_getAvailableRoles ( ) : array Returns a list of all available roles.
_getUserRoles ( array $user ) : array Returns a list of all roles belonging to the authenticated user.
_mapped ( array $roles ) : array
_parseFiles ( array | string | null $paths, string $file ) : array Returns the acl.ini file(s) as an array.
_prepareConfig ( array $config ) : array

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

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

Allows single or multi role based authorization
protected _check ( array $user, array $params ) : boolean
$user array User data
$params array Request params
Результат boolean Success

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

Constructs an ACL INI section key from a given Request.
protected _constructIniKey ( array $params ) : string
$params array The request params
Результат string Hash with named keys for controller, plugin and prefix

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

Deconstructs an ACL INI section key into a named array with ACL parts.
protected _deconstructIniKey ( string $key ) : array
$key string INI section key as found in acl.ini
Результат array Array with named keys for controller, plugin and prefix

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

protected _defaultConfig ( ) : array
Результат array

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

Uses cache for maximum performance. Improved speed by several actions before caching: - Resolves role slugs to their primary key / identifier - Resolves wildcards to their verbose translation
protected _getAcl ( string | array | null $path = null ) : array
$path string | array | null
Результат array Roles

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

Will look for a roles array in Configure first, tries database roles table next.
protected _getAvailableRoles ( ) : array
Результат array List with all available roles

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

Lookup in the following order: - single role id using the roleColumn in single-role mode - direct lookup in the pivot table (to support both Configure and Model in multi-role mode)
protected _getUserRoles ( array $user ) : array
$user array The user to get the roles for
Результат array List with all role ids belonging to the user

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

protected _mapped ( array $roles ) : array
$roles array
Результат array

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

Returns the acl.ini file(s) as an array.
protected _parseFiles ( array | string | null $paths, string $file ) : array
$paths array | string | null Paths to look for INI file
$file string Full path to the INI file
Результат array List with all available roles

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

protected _prepareConfig ( array $config ) : array
$config array
Результат array

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

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

protected array|null $_acl
Результат array | null

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

protected array|null $_roles
Результат array | null