public abstract class BasicRoleManager extends Object implements IRoleManager
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
createRole(String rolename)
Create a role with given rolename.
|
boolean |
deleteRole(String rolename)
Delete a role.
|
Role |
getRole(String rolename)
Get a role object.
|
boolean |
grantPrivilegeToRole(String rolename,
String path,
int privilegeId)
Grant a privilege on a seriesPath to a role.
|
List<String> |
listAllRoles()
List all roles in the database.
|
void |
replaceAllRoles(Map<String,Role> roles)
clear all old roles info, replace the old roles with the new one.
|
void |
reset()
Re-initialize this object.
|
boolean |
revokePrivilegeFromRole(String rolename,
String path,
int privilegeId)
Revoke a privilege on seriesPath from a role.
|
public Role getRole(String rolename) throws AuthException
IRoleManagergetRole 在接口中 IRoleManagerrolename - The name of the role.AuthException - if exception is raised while getting the role.public boolean createRole(String rolename) throws AuthException
IRoleManagercreateRole 在接口中 IRoleManagerrolename - is not null or emptyAuthException - f the given rolename is iIllegal.public boolean deleteRole(String rolename) throws AuthException
IRoleManagerdeleteRole 在接口中 IRoleManagerrolename - the rolename of the role.AuthException - if exception is raised while finding the role.public boolean grantPrivilegeToRole(String rolename, String path, int privilegeId) throws AuthException
IRoleManagergrantPrivilegeToRole 在接口中 IRoleManagerrolename - The rolename of the role to which the privilege should be added.path - The seriesPath on which the privilege takes effect. If the privilege is a
seriesPath-free privilege, this should be "root".privilegeId - An integer that represents a privilege.AuthException - If the role does not exist or the privilege or the seriesPath is illegal.public boolean revokePrivilegeFromRole(String rolename, String path, int privilegeId) throws AuthException
IRoleManagerrevokePrivilegeFromRole 在接口中 IRoleManagerrolename - The rolename of the role from which the privilege should be removed.path - The seriesPath on which the privilege takes effect. If the privilege is a
seriesPath-free privilege like 'CREATE_USER', this should be "root".privilegeId - An integer that represents a privilege.AuthException - If the role does not exist or the privilege or the seriesPath is illegal.public void reset()
IRoleManagerreset 在接口中 IRoleManagerpublic List<String> listAllRoles()
IRoleManagerlistAllRoles 在接口中 IRoleManagerpublic void replaceAllRoles(Map<String,Role> roles) throws AuthException
IRoleManagerreplaceAllRoles 在接口中 IRoleManagerroles - new roles infoAuthExceptionCopyright © 2022 The Apache Software Foundation. All rights reserved.