public interface IUserManager
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
createUser(String username,
String password)
Create a user with given username and password.
|
boolean |
deleteUser(String username)
Delete a user.
|
User |
getUser(String username)
Get a user object.
|
boolean |
grantPrivilegeToUser(String username,
String path,
int privilegeId)
Grant a privilege on a seriesPath to a user.
|
boolean |
grantRoleToUser(String roleName,
String username)
Add a role to a user.
|
boolean |
isUserUseWaterMark(String userName)
Whether data water-mark is enabled for user 'userName'.
|
List<String> |
listAllUsers()
List all users in the database.
|
void |
replaceAllUsers(Map<String,User> users)
clear all old users info, replace the old users with the new one.
|
void |
reset()
Re-initialize this object.
|
boolean |
revokePrivilegeFromUser(String username,
String path,
int privilegeId)
Revoke a privilege on seriesPath from a user.
|
boolean |
revokeRoleFromUser(String roleName,
String username)
Revoke a role from a user.
|
void |
setUserUseWaterMark(String userName,
boolean useWaterMark)
Enable or disable data water-mark for user 'userName'.
|
boolean |
updateUserPassword(String username,
String newPassword)
Modify the password of a user.
|
User getUser(String username) throws AuthException
username - The name of the user.AuthException - if an exception is raised when interacting with the lower storage.boolean createUser(String username, String password) throws AuthException
username - is not null or emptypassword - is not null or emptyAuthException - if the given username or password is illegal.boolean deleteUser(String username) throws AuthException
username - the username of the user.AuthException - .boolean grantPrivilegeToUser(String username, String path, int privilegeId) throws AuthException
username - The username of the user 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 user does not exist or the privilege or the seriesPath is illegal.boolean revokePrivilegeFromUser(String username, String path, int privilegeId) throws AuthException
username - The username of the user from which the privilege should be removed.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 user does not exist or the privilege or the seriesPath is illegal.boolean updateUserPassword(String username, String newPassword) throws AuthException
username - The user whose password is to be modified.newPassword - The new password.AuthException - If the user does not exists.boolean grantRoleToUser(String roleName, String username) throws AuthException
roleName - The name of the role to be added.username - The name of the user to which the role is added.AuthException - If the user does not exist.boolean revokeRoleFromUser(String roleName, String username) throws AuthException
roleName - The name of the role to be removed.username - The name of the user from which the role is removed.AuthException - If the user does not exist.void reset()
throws AuthException
AuthExceptionList<String> listAllUsers()
boolean isUserUseWaterMark(String userName) throws AuthException
userName - AuthException - if the user does not existvoid setUserUseWaterMark(String userName, boolean useWaterMark) throws AuthException
userName - useWaterMark - AuthException - if the user does not exist.void replaceAllUsers(Map<String,User> users) throws AuthException
users - new users infoAuthExceptionCopyright © 2022 The Apache Software Foundation. All rights reserved.