yii\rbac\CheckAccessInterface - Yii2 类参考手册
Interface yii\rbac\CheckAccessInterface
全部
| 方法 Methods
Implemented by | yii\rbac\ManagerInterface |
---|---|
Available since version | 2.0.9 |
For more details and usage information on CheckAccessInterface, see the guide article on security authorization.
Public Methods
隐藏继承的方法 Hide inherited methods
方法 Method | 简介 Description | 定义在 Defined By |
---|---|---|
checkAccess() | Checks if the user has the specified permission. | yii\rbac\CheckAccessInterface |
方法详情 Method Details
Checks if the user has the specified permission.
public abstract boolean checkAccess ( $userId, $permissionName, $params = [] ) | ||
$userId | string|integer | The user ID. This should be either an integer or a string representing the unique identifier of a user. See yii\web\User::$id. |
$permissionName | string | The name of the permission to be checked against |
$params | array | Name-value pairs that will be passed to the rules associated with the roles and permissions assigned to the user. |
return | boolean | Whether the user has the specified permission. |
---|---|---|
throws | yii\base\InvalidParamException | if $permissionName does not refer to an existing permission |