PHP Trait TinyAuth\Auth\AclTrait

Afficher le fichier Open project: dereuromark/cakephp-tinyauth

Protected Properties

Свойство Type Description
$_acl array | null
$_roles array | null

Méthodes protégées

Méthode Description
_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

Method Details

_check() protected méthode

Allows single or multi role based authorization
protected _check ( array $user, array $params ) : boolean
$user array User data
$params array Request params
Résultat boolean Success

_constructIniKey() protected méthode

Constructs an ACL INI section key from a given Request.
protected _constructIniKey ( array $params ) : string
$params array The request params
Résultat string Hash with named keys for controller, plugin and prefix

_deconstructIniKey() protected méthode

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
Résultat array Array with named keys for controller, plugin and prefix

_defaultConfig() protected méthode

protected _defaultConfig ( ) : array
Résultat array

_getAcl() protected méthode

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
Résultat array Roles

_getAvailableRoles() protected méthode

Will look for a roles array in Configure first, tries database roles table next.
protected _getAvailableRoles ( ) : array
Résultat array List with all available roles

_getUserRoles() protected méthode

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
Résultat array List with all role ids belonging to the user

_mapped() protected méthode

protected _mapped ( array $roles ) : array
$roles array
Résultat array

_parseFiles() protected méthode

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
Résultat array List with all available roles

_prepareConfig() protected méthode

protected _prepareConfig ( array $config ) : array
$config array
Résultat array

Property Details

$_acl protected_oe property

protected array|null $_acl
Résultat array | null

$_roles protected_oe property

protected array|null $_roles
Résultat array | null