|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.accumulo.core.client.admin.SecurityOperations org.apache.accumulo.core.client.mock.MockSecurityOperations
public class MockSecurityOperations
Method Summary | |
---|---|
boolean |
authenticateUser(java.lang.String name,
byte[] password)
Verify a username/password combination is valid |
void |
changeUserAuthorizations(java.lang.String name,
Authorizations authorizations)
Set the user's record-level authorizations |
void |
changeUserPassword(java.lang.String name,
byte[] password)
Set the user's password |
void |
createUser(java.lang.String user,
byte[] password,
Authorizations authorizations)
Create a user |
void |
dropUser(java.lang.String user)
Delete a user |
Authorizations |
getUserAuthorizations(java.lang.String name)
Retrieves the user's authorizations for scanning |
void |
grantSystemPermission(java.lang.String name,
SystemPermission permission)
Grant a user a system permission |
void |
grantTablePermission(java.lang.String name,
java.lang.String tableName,
TablePermission permission)
Grant a user a specific permission for a specific table |
boolean |
hasSystemPermission(java.lang.String name,
SystemPermission perm)
Verify the user has a particular system permission |
boolean |
hasTablePermission(java.lang.String name,
java.lang.String tableName,
TablePermission perm)
Verify the user has a particular table permission |
java.util.Set<java.lang.String> |
listUsers()
Return a list of users in accumulo |
void |
revokeSystemPermission(java.lang.String name,
SystemPermission permission)
Revoke a system permission from a user |
void |
revokeTablePermission(java.lang.String name,
java.lang.String tableName,
TablePermission permission)
Revoke a table permission for a specific user on a specific table |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void createUser(java.lang.String user, byte[] password, Authorizations authorizations) throws AccumuloException, AccumuloSecurityException
SecurityOperations
createUser
in class SecurityOperations
user
- the name of the user to createpassword
- the plaintext password for the userauthorizations
- the authorizations that the user has for scanning
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permission to create a userpublic void dropUser(java.lang.String user) throws AccumuloException, AccumuloSecurityException
SecurityOperations
dropUser
in class SecurityOperations
user
- the user name to delete
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permission to delete a userpublic boolean authenticateUser(java.lang.String name, byte[] password) throws AccumuloException, AccumuloSecurityException
SecurityOperations
authenticateUser
in class SecurityOperations
name
- the name of the user to authenticatepassword
- the plaintext password for the user
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permission to askpublic void changeUserPassword(java.lang.String name, byte[] password) throws AccumuloException, AccumuloSecurityException
SecurityOperations
changeUserPassword
in class SecurityOperations
name
- the name of the user to modifypassword
- the plaintext password for the user
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permission to modify a userpublic void changeUserAuthorizations(java.lang.String name, Authorizations authorizations) throws AccumuloException, AccumuloSecurityException
SecurityOperations
changeUserAuthorizations
in class SecurityOperations
name
- the name of the user to modifyauthorizations
- the authorizations that the user has for scanning
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permission to modify a userpublic Authorizations getUserAuthorizations(java.lang.String name) throws AccumuloException, AccumuloSecurityException
SecurityOperations
getUserAuthorizations
in class SecurityOperations
name
- the name of the user to query
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permission to query a userpublic boolean hasSystemPermission(java.lang.String name, SystemPermission perm) throws AccumuloException, AccumuloSecurityException
SecurityOperations
hasSystemPermission
in class SecurityOperations
name
- the name of the user to queryperm
- the system permission to check for
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permission to query a userpublic boolean hasTablePermission(java.lang.String name, java.lang.String tableName, TablePermission perm) throws AccumuloException, AccumuloSecurityException
SecurityOperations
hasTablePermission
in class SecurityOperations
name
- the name of the user to querytableName
- the name of the table to query aboutperm
- the table permission to check for
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permission to query a userpublic void grantSystemPermission(java.lang.String name, SystemPermission permission) throws AccumuloException, AccumuloSecurityException
SecurityOperations
grantSystemPermission
in class SecurityOperations
name
- the name of the user to modifypermission
- the system permission to grant to the user
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permission to grant a user permissionspublic void grantTablePermission(java.lang.String name, java.lang.String tableName, TablePermission permission) throws AccumuloException, AccumuloSecurityException
SecurityOperations
grantTablePermission
in class SecurityOperations
name
- the name of the user to modifytableName
- the name of the table to modify for the userpermission
- the table permission to grant to the user
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permission to grant a user permissionspublic void revokeSystemPermission(java.lang.String name, SystemPermission permission) throws AccumuloException, AccumuloSecurityException
SecurityOperations
revokeSystemPermission
in class SecurityOperations
name
- the name of the user to modifypermission
- the system permission to revoke for the user
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permission to revoke a user's permissionspublic void revokeTablePermission(java.lang.String name, java.lang.String tableName, TablePermission permission) throws AccumuloException, AccumuloSecurityException
SecurityOperations
revokeTablePermission
in class SecurityOperations
name
- the name of the user to modifytableName
- the name of the table to modify for the userpermission
- the table permission to revoke for the user
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permission to revoke a user's permissionspublic java.util.Set<java.lang.String> listUsers() throws AccumuloException, AccumuloSecurityException
SecurityOperations
listUsers
in class SecurityOperations
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permission to query users
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |