Свойство | Тип | Описание | |
---|---|---|---|
$defaultRoles | a list of role names that are assigned to every user automatically without calling [[assign()]]. |
Метод | Описание | |
---|---|---|
add ( $object ) | ||
createPermission ( $name ) | ||
createRole ( $name ) | ||
getPermission ( $name ) | ||
getPermissions ( ) | ||
getRole ( $name ) | ||
getRoles ( ) | ||
remove ( $object ) | ||
update ( $name, $object ) |
Метод | Описание | |
---|---|---|
addItem ( |
Adds an auth item to the RBAC system. | |
addRule ( |
Adds a rule to the RBAC system. | |
executeRule ( string | integer $user, |
Executes the rule associated with the specified auth item. | |
getItem ( string $name ) : |
Returns the named auth item. | |
getItems ( integer $type ) : |
Returns the items of the specified type. | |
removeItem ( |
Removes an auth item from the RBAC system. | |
removeRule ( |
Removes a rule from the RBAC system. | |
updateItem ( string $name, |
Updates an auth item in the RBAC system. | |
updateRule ( string $name, |
Updates a rule to the RBAC system. |
protected executeRule ( string | integer $user, |
||
$user | 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]]. |
$item | the auth item that needs to execute its rule | |
$params | array | parameters passed to [[CheckAccessInterface::checkAccess()]] and will be passed to the rule |
Результат | boolean | the return value of [[Rule::execute()]]. If the auth item does not specify a rule, true will be returned. |
abstract protected removeItem ( |
||
$item | the item to remove | |
Результат | boolean | whether the role or permission is successfully removed |
abstract protected removeRule ( |
||
$rule | the rule to remove | |
Результат | boolean | whether the rule is successfully removed |
abstract protected updateItem ( string $name, |
||
$name | string | the name of the item being updated |
$item | the updated item | |
Результат | boolean | whether the auth item is successfully updated |
abstract protected updateRule ( string $name, |
||
$name | string | the name of the rule being updated |
$rule | the updated rule | |
Результат | boolean | whether the rule is successfully updated |