public class SecurityOperationsImpl extends Object implements SecurityOperations
| Constructor and Description |
|---|
SecurityOperationsImpl(Instance instance,
org.apache.accumulo.core.security.thrift.AuthInfo credentials) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
authenticateUser(String user,
byte[] password)
Verify a username/password combination is valid
|
void |
changeUserAuthorizations(String user,
Authorizations authorizations)
Set the user's record-level authorizations
|
void |
changeUserPassword(String user,
byte[] password)
Set the user's password
|
void |
createUser(String user,
byte[] password,
Authorizations authorizations)
Create a user
|
void |
dropUser(String user)
Delete a user
|
Authorizations |
getUserAuthorizations(String user)
Retrieves the user's authorizations for scanning
|
void |
grantSystemPermission(String user,
SystemPermission permission)
Grant a user a system permission
|
void |
grantTablePermission(String user,
String table,
TablePermission permission)
Grant a user a specific permission for a specific table
|
boolean |
hasSystemPermission(String user,
SystemPermission perm)
Verify the user has a particular system permission
|
boolean |
hasTablePermission(String user,
String table,
TablePermission perm)
Verify the user has a particular table permission
|
Set<String> |
listUsers()
Return a list of users in accumulo
|
void |
revokeSystemPermission(String user,
SystemPermission permission)
Revoke a system permission from a user
|
void |
revokeTablePermission(String user,
String table,
TablePermission permission)
Revoke a table permission for a specific user on a specific table
|
public SecurityOperationsImpl(Instance instance, org.apache.accumulo.core.security.thrift.AuthInfo credentials)
instance - the connection informationcredentials - the user credentials to use for security operationspublic void createUser(String user, byte[] password, Authorizations authorizations) throws AccumuloException, AccumuloSecurityException
createUser in interface SecurityOperationsuser - the name of the user to createpassword - the plaintext password for the userauthorizations - the authorizations that the user has for scanningAccumuloException - if a general error occursAccumuloSecurityException - if the user does not have permission to create a userpublic void dropUser(String user) throws AccumuloException, AccumuloSecurityException
dropUser in interface SecurityOperationsuser - the user name to deleteAccumuloException - if a general error occursAccumuloSecurityException - if the user does not have permission to delete a userpublic boolean authenticateUser(String user, byte[] password) throws AccumuloException, AccumuloSecurityException
authenticateUser in interface SecurityOperationsuser - the name of the user to authenticatepassword - the plaintext password for the userAccumuloException - if a general error occursAccumuloSecurityException - if the user does not have permission to askpublic void changeUserPassword(String user, byte[] password) throws AccumuloException, AccumuloSecurityException
changeUserPassword in interface SecurityOperationsuser - the name of the user to modifypassword - the plaintext password for the userAccumuloException - if a general error occursAccumuloSecurityException - if the user does not have permission to modify a userpublic void changeUserAuthorizations(String user, Authorizations authorizations) throws AccumuloException, AccumuloSecurityException
changeUserAuthorizations in interface SecurityOperationsuser - the name of the user to modifyauthorizations - the authorizations that the user has for scanningAccumuloException - if a general error occursAccumuloSecurityException - if the user does not have permission to modify a userpublic Authorizations getUserAuthorizations(String user) throws AccumuloException, AccumuloSecurityException
getUserAuthorizations in interface SecurityOperationsuser - the name of the user to queryAccumuloException - if a general error occursAccumuloSecurityException - if the user does not have permission to query a userpublic boolean hasSystemPermission(String user, SystemPermission perm) throws AccumuloException, AccumuloSecurityException
hasSystemPermission in interface SecurityOperationsuser - the name of the user to queryperm - the system permission to check forAccumuloException - if a general error occursAccumuloSecurityException - if the user does not have permission to query a userpublic boolean hasTablePermission(String user, String table, TablePermission perm) throws AccumuloException, AccumuloSecurityException
hasTablePermission in interface SecurityOperationsuser - the name of the user to querytable - the name of the table to query aboutperm - the table permission to check forAccumuloException - if a general error occursAccumuloSecurityException - if the user does not have permission to query a userpublic void grantSystemPermission(String user, SystemPermission permission) throws AccumuloException, AccumuloSecurityException
grantSystemPermission in interface SecurityOperationsuser - the name of the user to modifypermission - the system permission to grant to the userAccumuloException - if a general error occursAccumuloSecurityException - if the user does not have permission to grant a user permissionspublic void grantTablePermission(String user, String table, TablePermission permission) throws AccumuloException, AccumuloSecurityException
grantTablePermission in interface SecurityOperationsuser - the name of the user to modifytable - the name of the table to modify for the userpermission - the table permission to grant to the userAccumuloException - if a general error occursAccumuloSecurityException - if the user does not have permission to grant a user permissionspublic void revokeSystemPermission(String user, SystemPermission permission) throws AccumuloException, AccumuloSecurityException
revokeSystemPermission in interface SecurityOperationsuser - the name of the user to modifypermission - the system permission to revoke for the userAccumuloException - if a general error occursAccumuloSecurityException - if the user does not have permission to revoke a user's permissionspublic void revokeTablePermission(String user, String table, TablePermission permission) throws AccumuloException, AccumuloSecurityException
revokeTablePermission in interface SecurityOperationsuser - the name of the user to modifytable - the name of the table to modify for the userpermission - the table permission to revoke for the userAccumuloException - if a general error occursAccumuloSecurityException - if the user does not have permission to revoke a user's permissionspublic Set<String> listUsers() throws AccumuloException, AccumuloSecurityException
listUsers in interface SecurityOperationsAccumuloException - if a general error occursAccumuloSecurityException - if the user does not have permission to query usersCopyright © 2016 The Apache Software Foundation. All Rights Reserved.