CheckAccessInterface
in
For more details and usage information on CheckAccessInterface, see the [guide article on security authorization](guide:security-authorization).
Tags
Table of Contents
Methods
- checkAccess() : bool
- Checks if the user has the specified permission.
Methods
checkAccess()
Checks if the user has the specified permission.
public
checkAccess(string|int $userId, string $permissionName[, array<string|int, mixed> $params = [] ]) : bool
Parameters
- $userId : string|int
-
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<string|int, mixed> = []
-
name-value pairs that will be passed to the rules associated with the roles and permissions assigned to the user.
Tags
Return values
bool —whether the user has the specified permission.