For more details and usage information on ManagerInterface, see the guide article on security authorization.
Method DetailsAdds a role, permission or rule to the RBAC system.
public function add($object);
Adds an item as a child of another item.
public function addChild($parent, $child);
Assigns a role to a user.
public function assign($role, $userId);
Checks the possibility of adding a child to parent.
public function canAddChild($parent, $child);
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 stringThe name of the permission to be checked against
$params arrayName-value pairs that will be passed to the rules associated with the roles and permissions assigned to the user.
return booleanWhether the user has the specified permission.
throws yii\base\InvalidParamExceptionif $permissionName does not refer to an existing permission
public function checkAccess($userId, $permissionName, $params = []);
Creates a new Permission object.
Note that the newly created permission is not added to the RBAC system yet. You must fill in the needed data and call add() to add it to the system.
public function createPermission($name);
Creates a new Role object.
Note that the newly created role is not added to the RBAC system yet. You must fill in the needed data and call add() to add it to the system.
public function createRole($name);
Returns the assignment information regarding a role and a user.
public function getAssignment($roleName, $userId);
Returns all role assignment information for the specified user.
public function getAssignments($userId);
Returns child roles of the role specified. Depth isn't limited.
public function getChildRoles($roleName);
Returns the child permissions and/or roles.
public function getChildren($name);
Returns the named permission.
public function getPermission($name);
Returns all permissions in the system.
public function getPermissions();
Returns all permissions that the specified role represents.
public function getPermissionsByRole($roleName);
Returns all permissions that the user has.
public function getPermissionsByUser($userId);
Returns the named role.
public function getRole($name);
Returns all roles in the system.
public function getRoles();
Returns the roles that are assigned to the user via assign().
Note that child roles that are not assigned directly to the user will not be returned.
public function getRolesByUser($userId);
Returns the rule of the specified name.
public function getRule($name);
Returns all rules available in the system.
public function getRules();
Returns all user IDs assigned to the role specified.
public function getUserIdsByRole($roleName);
Returns a value indicating whether the child already exists for the parent.
public function hasChild($parent, $child);
Removes a role, permission or rule from the RBAC system.
public function remove($object);
Removes all authorization data, including roles, permissions, rules, and assignments.
public function removeAll();
Removes all role assignments.
public function removeAllAssignments();
Removes all permissions.
All parent child relations will be adjusted accordingly.
public function removeAllPermissions();
Removes all roles.
All parent child relations will be adjusted accordingly.
public function removeAllRoles();
Removes all rules.
All roles and permissions which have rules will be adjusted accordingly.
public function removeAllRules();
Removes a child from its parent.
Note, the child item is not deleted. Only the parent-child relationship is removed.
public function removeChild($parent, $child);
Removed all children form their parent.
Note, the children items are not deleted. Only the parent-child relationships are removed.
public function removeChildren($parent);
Revokes a role from a user.
public function revoke($role, $userId);
Revokes all roles from a user.
public function revokeAll($userId);
Updates the specified role, permission or rule in the system.
public function update($name, $object);
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4