public interface IRoleManager
Modifier and Type | Interface and Description |
---|---|
static class |
IRoleManager.Option
Supported options for CREATE ROLE/ALTER ROLE (and
CREATE USER/ALTER USER, which are aliases provided
for backwards compatibility).
|
Modifier and Type | Method and Description |
---|---|
java.util.Set<IRoleManager.Option> |
alterableOptions()
Subset of supportedOptions that users are allowed to alter when performing ALTER ROLE [themselves].
|
void |
alterRole(AuthenticatedUser performer,
RoleResource role,
RoleOptions options)
Called during execution of ALTER ROLE statement.
|
boolean |
canLogin(RoleResource role)
Return true if there exists a Role with the given name which has login
privileges.
|
void |
createRole(AuthenticatedUser performer,
RoleResource role,
RoleOptions options)
Called during execution of a CREATE ROLE statement.
|
void |
dropRole(AuthenticatedUser performer,
RoleResource role)
Called during execution of DROP ROLE statement, as well we removing any main record of the role from the system
this implies that we want to revoke this role from all other roles that it has been granted to.
|
java.util.Set<RoleResource> |
getAllRoles()
Called during the execution of an unqualified LIST ROLES query.
|
java.util.Map<java.lang.String,java.lang.String> |
getCustomOptions(RoleResource role)
Where an implementation supports OPTIONS in CREATE and ALTER operations
this method should return the
Map<String, String> representing the custom
options associated with the role, as supplied to CREATE or ALTER. |
default java.util.Set<Role> |
getRoleDetails(RoleResource grantee)
Used to retrieve detailed role info on the full set of roles granted to a grantee.
|
java.util.Set<RoleResource> |
getRoles(RoleResource grantee,
boolean includeInherited)
Called during execution of a LIST ROLES query.
|
void |
grantRole(AuthenticatedUser performer,
RoleResource role,
RoleResource grantee)
Called during execution of GRANT ROLE query.
|
boolean |
isExistingRole(RoleResource role)
Return true is a Role with the given name exists in the system.
|
boolean |
isSuper(RoleResource role)
Return true if there exists a Role with the given name that also has
superuser status.
|
java.util.Set<? extends IResource> |
protectedResources()
Set of resources that should be made inaccessible to users and only accessible internally.
|
void |
revokeRole(AuthenticatedUser performer,
RoleResource role,
RoleResource revokee)
Called during the execution of a REVOKE ROLE query.
|
void |
setup()
Hook to perform implementation specific initialization, called once upon system startup.
|
java.util.Set<IRoleManager.Option> |
supportedOptions()
Set of options supported by CREATE ROLE and ALTER ROLE queries.
|
void |
validateConfiguration()
Hook to perform validation of an implementation's configuration (if supported).
|
java.util.Set<IRoleManager.Option> supportedOptions()
java.util.Set<IRoleManager.Option> alterableOptions()
void createRole(AuthenticatedUser performer, RoleResource role, RoleOptions options) throws RequestValidationException, RequestExecutionException
performer
- User issuing the create role statement.role
- Rolei being createdoptions
- Options the role will be created withRequestValidationException
RequestExecutionException
void dropRole(AuthenticatedUser performer, RoleResource role) throws RequestValidationException, RequestExecutionException
performer
- User issuing the drop role statement.role
- Role to be dropped.RequestValidationException
RequestExecutionException
void alterRole(AuthenticatedUser performer, RoleResource role, RoleOptions options) throws RequestValidationException, RequestExecutionException
performer
- User issuing the alter role statement.role
- Role that will be altered.options
- Options to alter.RequestValidationException
RequestExecutionException
void grantRole(AuthenticatedUser performer, RoleResource role, RoleResource grantee) throws RequestValidationException, RequestExecutionException
performer
- User issuing the grant statement.role
- Role to be granted to the grantee.grantee
- Role acting as the grantee.RequestValidationException
RequestExecutionException
void revokeRole(AuthenticatedUser performer, RoleResource role, RoleResource revokee) throws RequestValidationException, RequestExecutionException
performer
- User issuing the revoke statement.role
- Role to be revoked.revokee
- Role from which the granted role is to be revoked.RequestValidationException
RequestExecutionException
java.util.Set<RoleResource> getRoles(RoleResource grantee, boolean includeInherited) throws RequestValidationException, RequestExecutionException
grantee
- Role whose granted roles will be listed.includeInherited
- if True will list inherited roles as well as those directly granted to the grantee.RequestValidationException
RequestExecutionException
default java.util.Set<Role> getRoleDetails(RoleResource grantee)
grantee
- identifies the role whose granted roles are retrievedjava.util.Set<RoleResource> getAllRoles() throws RequestValidationException, RequestExecutionException
RequestValidationException
RequestExecutionException
boolean isSuper(RoleResource role)
role
- Role whose superuser status to verifyboolean canLogin(RoleResource role)
role
- Role whose login privileges to verifyjava.util.Map<java.lang.String,java.lang.String> getCustomOptions(RoleResource role)
Map<String, String>
representing the custom
options associated with the role, as supplied to CREATE or ALTER.
It should never return null; if the implementation does not support
OPTIONS or if none were supplied then it should return an empty map.role
- Role whose custom options are requiredboolean isExistingRole(RoleResource role)
role
- Role whose existence to verifyjava.util.Set<? extends IResource> protectedResources()
void validateConfiguration() throws ConfigurationException
ConfigurationException
void setup()
Copyright © 2009- The Apache Software Foundation