Метод | Описание | |
---|---|---|
add ( |
Adds a role, permission or rule to the RBAC system. | |
addChild ( |
Adds an item as a child of another item. | |
assign ( |
Assigns a role to a user. | |
canAddChild ( |
Checks the possibility of adding a child to parent | |
createPermission ( string $name ) : |
Creates a new Permission object. | |
createRole ( string $name ) : |
Creates a new Role object. | |
getAssignment ( string $roleName, string | integer $userId ) : null | |
Returns the assignment information regarding a role and a user. | |
getAssignments ( string | integer $userId ) : |
Returns all role assignment information for the specified user. | |
getChildRoles ( string $roleName ) : |
Returns child roles of the role specified. Depth isn't limited. | |
getChildren ( string $name ) : |
Returns the child permissions and/or roles. | |
getPermission ( string $name ) : null | |
Returns the named permission. | |
getPermissions ( ) : |
Returns all permissions in the system. | |
getPermissionsByRole ( string $roleName ) : |
Returns all permissions that the specified role represents. | |
getPermissionsByUser ( string | integer $userId ) : |
Returns all permissions that the user has. | |
getRole ( string $name ) : null | |
Returns the named role. | |
getRoles ( ) : |
Returns all roles in the system. | |
getRolesByUser ( string | integer $userId ) : |
Returns the roles that are assigned to the user via ManagerInterface::assign. | |
getRule ( string $name ) : null | |
Returns the rule of the specified name. | |
getRules ( ) : |
Returns all rules available in the system. | |
getUserIdsByRole ( string $roleName ) : array | Returns all user IDs assigned to the role specified. | |
hasChild ( |
Returns a value indicating whether the child already exists for the parent. | |
remove ( |
Removes a role, permission or rule from the RBAC system. | |
removeAll ( ) | Removes all authorization data, including roles, permissions, rules, and assignments. | |
removeAllAssignments ( ) | Removes all role assignments. | |
removeAllPermissions ( ) | Removes all permissions. | |
removeAllRoles ( ) | Removes all roles. | |
removeAllRules ( ) | Removes all rules. | |
removeChild ( |
Removes a child from its parent. | |
removeChildren ( |
Removed all children form their parent. | |
revoke ( |
Revokes a role from a user. | |
revokeAll ( mixed $userId ) : boolean | Revokes all roles from a user. | |
update ( string $name, |
Updates the specified role, permission or rule in the system. |
public canAddChild ( |
||
$parent | the parent item | |
$child | the child item to be added to the hierarchy | |
Результат | boolean | possibility of adding |
public createPermission ( string $name ) : |
||
$name | string | the permission name |
Результат | the new Permission object |
public createRole ( string $name ) : |
||
$name | string | the role name |
Результат | the new Role object |
public getAssignments ( string | integer $userId ) : |
||
$userId | string | integer | the user ID (see [[\yii\web\User::id]]) |
Результат | the assignments indexed by role names. An empty array will be returned if there is no role assigned to the user. |
public getChildRoles ( string $roleName ) : |
||
$roleName | string | name of the role to file child roles for |
Результат | Child roles. The array is indexed by the role names. First element is an instance of the parent Role itself. |
public getChildren ( string $name ) : |
||
$name | string | the parent name |
Результат | the child permissions and/or roles |
public getPermission ( string $name ) : null | |
||
$name | string | the permission name. |
Результат | null | |
the permission corresponding to the specified name. Null is returned if no such permission. |
public getPermissions ( ) : |
||
Результат | all permissions in the system. The array is indexed by the permission names. |
public getPermissionsByRole ( string $roleName ) : |
||
$roleName | string | the role name |
Результат | all permissions that the role represents. The array is indexed by the permission names. |
public getPermissionsByUser ( string | integer $userId ) : |
||
$userId | string | integer | the user ID (see [[\yii\web\User::id]]) |
Результат | all permissions that the user has. The array is indexed by the permission names. |
public getRoles ( ) : |
||
Результат | all roles in the system. The array is indexed by the role names. |
public getRolesByUser ( string | integer $userId ) : |
||
$userId | string | integer | the user ID (see [[\yii\web\User::id]]) |
Результат | all roles directly assigned to the user. The array is indexed by the role names. |
public getRules ( ) : |
||
Результат | the rules indexed by the rule names |
public getUserIdsByRole ( string $roleName ) : array | ||
$roleName | string | |
Результат | array | array of user ID strings |
public removeAll ( ) |
public removeAllAssignments ( ) |
public removeAllPermissions ( ) |
public removeAllRoles ( ) |
public removeAllRules ( ) |
public removeChild ( |
||
$parent | ||
$child | ||
Результат | boolean | whether the removal is successful |
public removeChildren ( |
||
$parent | ||
Результат | boolean | whether the removal is successful |