Abstract Class yii\filters\auth\AuthMethod
AuthMethod is a base class implementing the yii\filters\auth\AuthInterface interface.
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$except | array | List of action IDs that this filter should not apply to. | yii\base\ActionFilter |
$only | array | List of action IDs that this filter should apply to. | yii\base\ActionFilter |
$optional | array | List of action IDs that this filter will be applied to, but auth failure will not lead to error. | yii\filters\auth\AuthMethod |
$owner | yii\base\Component|null | The owner of this behavior | yii\base\Behavior |
$request | yii\web\Request | The current request. | yii\filters\auth\AuthMethod |
$response | yii\web\Response | The response to be sent. | yii\filters\auth\AuthMethod |
$user | yii\web\User | The user object representing the user authentication status. | yii\filters\auth\AuthMethod |
Public Methods
Method | Description | Defined By |
---|---|---|
__call() | Calls the named method which is not a class method. | yii\base\BaseObject |
__construct() | Constructor. | yii\base\BaseObject |
__get() | Returns the value of an object property. | yii\base\BaseObject |
__isset() | Checks if a property is set, i.e. defined and not null. | yii\base\BaseObject |
__set() | Sets value of an object property. | yii\base\BaseObject |
__unset() | Sets an object property to null. | yii\base\BaseObject |
afterAction() | This method is invoked right after an action is executed. | yii\base\ActionFilter |
afterFilter() | yii\base\ActionFilter | |
attach() | {@inheritdoc} | yii\base\ActionFilter |
authenticate() | Authenticates the current user. | yii\filters\auth\AuthInterface |
beforeAction() | {@inheritdoc} | yii\filters\auth\AuthMethod |
beforeFilter() | yii\base\ActionFilter | |
canGetProperty() | Returns a value indicating whether a property can be read. | yii\base\BaseObject |
canSetProperty() | Returns a value indicating whether a property can be set. | yii\base\BaseObject |
challenge() | {@inheritdoc} | yii\filters\auth\AuthMethod |
className() | Returns the fully qualified name of this class. | yii\base\BaseObject |
detach() | {@inheritdoc} | yii\base\ActionFilter |
events() | Declares event handlers for the $owner's events. | yii\base\Behavior |
handleFailure() | {@inheritdoc} | yii\filters\auth\AuthMethod |
hasMethod() | Returns a value indicating whether a method is defined. | yii\base\BaseObject |
hasProperty() | Returns a value indicating whether a property is defined. | yii\base\BaseObject |
init() | Initializes the object. | yii\base\BaseObject |
Protected Methods
Method | Description | Defined By |
---|---|---|
getActionId() | Returns an action ID by converting yii\base\Action::$uniqueId into an ID relative to the module. | yii\base\ActionFilter |
isActive() | Returns a value indicating whether the filter is active for the given action. | yii\base\ActionFilter |
isOptional() | Checks, whether authentication is optional for the given action. | yii\filters\auth\AuthMethod |
Property Details
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().
The current request. If not set, the request
application component will be used.
The response to be sent. If not set, the response
application component will be used.
The user object representing the user authentication status. If not set, the user
application component will be used.
Method Details
{@inheritdoc}
public void beforeAction ( $action ) | ||
$action |
{@inheritdoc}
public void challenge ( $response ) | ||
$response |
{@inheritdoc}
public void handleFailure ( $response ) | ||
$response |
Checks, whether authentication is optional for the given action.
See also $optional.
protected boolean isOptional ( $action ) | ||
$action | yii\base\Action | Action to be checked. |
return | boolean | Whether authentication is optional or not. |
---|