PHP Class yii\filters\auth\AuthMethod

Since: 2.0
Author: Qiang Xue ([email protected])
Inheritance: extends yii\base\ActionFilter, implements yii\filters\auth\AuthInterface
Afficher le fichier Open project: yiisoft/yii2 Class Usage Examples

Méthodes publiques

Свойство Type Description
$optional list of action IDs that this filter will be applied to, but auth failure will not lead to error. It may be used for actions, that are allowed for public, but return some additional data for authenticated users. Defaults to empty, meaning authentication is not optional for any action. Since version 2.0.10 action IDs can be specified as wildcards, e.g. site/*.
$request the current request. If not set, the request application component will be used.
$response the response to be sent. If not set, the response application component will be used.
$user the user object representing the user authentication status. If not set, the user application component will be used.

Méthodes publiques

Méthode Description
beforeAction ( $action )
challenge ( $response )
handleFailure ( $response )

Méthodes protégées

Méthode Description
isOptional ( Action $action ) : boolean Checks, whether authentication is optional for the given action.

Method Details

beforeAction() public méthode

public beforeAction ( $action )

challenge() public méthode

public challenge ( $response )

handleFailure() public méthode

public handleFailure ( $response )

isOptional() protected méthode

Checks, whether authentication is optional for the given action.
See also: optional
Since: 2.0.7
protected isOptional ( Action $action ) : boolean
$action yii\base\Action action to be checked.
Résultat boolean whether authentication is optional or not.

Property Details

$optional public_oe property

list of action IDs that this filter will be applied to, but auth failure will not lead to error. It may be used for actions, that are allowed for public, but return some additional data for authenticated users. Defaults to empty, meaning authentication is not optional for any action. Since version 2.0.10 action IDs can be specified as wildcards, e.g. site/*.
See also: isOptional()
Since: 2.0.7
public $optional

$request public_oe property

the current request. If not set, the request application component will be used.
public $request

$response public_oe property

the response to be sent. If not set, the response application component will be used.
public $response

$user public_oe property

the user object representing the user authentication status. If not set, the user application component will be used.
public $user