PHP Class li3_access\security\Access

Inheritance: extends lithium\core\Adaptable
Afficher le fichier Open project: tmaiaroto/li3_access Class Usage Examples

Protected Properties

Свойство Type Description
$_adapters Libraries::locate() compatible path to adapters for this class.
$_classes Dynamic class dependencies.
$_configurations Stores configurations for various authentication adapters.

Méthodes publiques

Méthode Description
check ( string $name, mixed $user, mixed $params, array $options = [] ) : Array Performs an access check against the specified configuration, and returns true if access is permitted and an array with additional details if access is denied.

Méthodes protégées

Méthode Description
_initConfig ( string $name, array $config ) : array Called when an adapter configuration is first accessed, this method sets the default configuration for session handling. While each configuration can use its own session class and options, this method initializes them to the default dependencies written into the class.

Method Details

_initConfig() protected static méthode

For the session key name, the default value is set to the name of the configuration.
protected static _initConfig ( string $name, array $config ) : array
$name string The name of the adapter configuration being accessed.
$config array The user-specified configuration.
Résultat array Returns an array that merges the user-specified configuration with the generated default values.

check() public static méthode

The data return when access is not permitted will vary by adapter, but it is ideal to have a "message" and a "redirect" so that a user can be notified about why they were denied access and so they can be redirected somewhere to, perhaps, login.
public static check ( string $name, mixed $user, mixed $params, array $options = [] ) : Array
$name string The name of the `Access` configuration/adapter to check against.
$user mixed The user data array that holds all necessary information about the user requesting access. Or `false` (because `Auth::check()` can return `false`).
$params mixed The Lithium `Request` object, or an array with at least 'request', and 'params'
$options array An array of additional options.
Résultat Array An empty array if access is allowed and an array with reasons for denial if denied.

Property Details

$_adapters protected_oe static_oe property

Libraries::locate() compatible path to adapters for this class.
See also: lithium\core\Libraries::locate()
protected static $_adapters

$_classes protected_oe static_oe property

Dynamic class dependencies.
protected static $_classes

$_configurations protected_oe static_oe property

Stores configurations for various authentication adapters.
protected static $_configurations