Package org.casbin.jcasbin.rbac
Interface RoleManager
- All Known Implementing Classes:
ConditionalRoleManager,DefaultRoleManager,DomainManager,GroupRoleManager
public interface RoleManager
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddLink adds the inheritance link between two roles.voidclear()Clear clears all stored data and resets the role manager to the initial state.voiddeleteLink(String name1, String name2, String... domain) deleteLink deletes the inheritance link between two roles.getRoles gets the roles that a user inherits.getUsers gets the users that inherits a role.booleanhasLink determines whether a link exists between two roles.voidprintRoles prints all the roles to log.
-
Method Details
-
clear
void clear()Clear clears all stored data and resets the role manager to the initial state. -
addLink
addLink adds the inheritance link between two roles. role: name1 and role: name2. domain is a prefix to the roles.- Parameters:
name1- the first role (or user).name2- the second role.domain- the domain the roles belong to.
-
deleteLink
deleteLink deletes the inheritance link between two roles. role: name1 and role: name2. domain is a prefix to the roles.- Parameters:
name1- the first role (or user).name2- the second role.domain- the domain the roles belong to.
-
hasLink
hasLink determines whether a link exists between two roles. role: name1 inherits role: name2. domain is a prefix to the roles.- Parameters:
name1- the first role (or a user).name2- the second role.domain- the domain the roles belong to.- Returns:
- whether name1 inherits name2 (name1 has role name2).
-
getRoles
getRoles gets the roles that a user inherits. domain is a prefix to the roles.- Parameters:
name- the user (or a role).domain- the domain the roles belong to.- Returns:
- the roles.
-
getUsers
getUsers gets the users that inherits a role.- Parameters:
name- the role.domain- is a prefix to the users (can be used for other purposes).- Returns:
- the users.
-
printRoles
void printRoles()printRoles prints all the roles to log.
-