public class LocalUserAdministration extends Object implements UserAdministration
| Constructor and Description |
|---|
LocalUserAdministration(UserSession session) |
| Modifier and Type | Method and Description |
|---|---|
void |
addUser(String username,
String allowedHost,
String password)
Add a new user to the database, this user will be allowed to connected from the specified host or all hosts
if the wildcard '*' is used.
|
void |
deleteUser(String username)
Deletes a user from the database, does not revoke grants
|
List<String> |
getUsers()
Gets a list of all the users
|
void |
grant(String username,
String object,
AccessMode mode)
GrantObject the user access to the specified object with the given access level
|
void |
revoke(String username,
String object)
Revokes a grant for a given user
|
public LocalUserAdministration(UserSession session) throws JasDBStorageException
JasDBStorageExceptionpublic void addUser(String username, String allowedHost, String password) throws JasDBStorageException
UserAdministrationaddUser in interface UserAdministrationusername - The name of the userallowedHost - The allowed host, '*' for wildcardpassword - The password of the userJasDBStorageException - If unable to create the user due to insufficient permissionspublic void deleteUser(String username) throws JasDBStorageException
UserAdministrationdeleteUser in interface UserAdministrationusername - The name of the userJasDBStorageException - If unable to delete the user due to insufficient permissionspublic List<String> getUsers() throws JasDBStorageException
UserAdministrationgetUsers in interface UserAdministrationJasDBStorageException - If unable to get the list of userspublic void grant(String username, String object, AccessMode mode) throws JasDBStorageException
UserAdministrationgrant in interface UserAdministrationusername - The usernameobject - The object to grant permissions tomode - The mode of allowed accessJasDBStorageException - If unable to grant, for example with insufficient permissionspublic void revoke(String username, String object) throws JasDBStorageException
UserAdministrationrevoke in interface UserAdministrationusername - The user to revoke the grant fromobject - The object to revoke onJasDBStorageException - If unable to revoke the grant, for example with insufficient permissionseCopyright © 2015. All rights reserved.