PHP Interface yii\rbac\CheckAccessInterface

Since: 2.0.9
Author: Sam Mousa ([email protected])
Datei anzeigen Open project: yiisoft/yii2

Public Methods

Method Description
checkAccess ( string | integer $userId, string $permissionName, array $params = [] ) : boolean Checks if the user has the specified permission.

Method Details

checkAccess() public method

Checks if the user has the specified permission.
public checkAccess ( string | integer $userId, string $permissionName, array $params = [] ) : boolean
$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.