|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cassandra.auth.LegacyAuthorizer
public abstract class LegacyAuthorizer
Provides a transitional IAuthorizer implementation for old-style (pre-1.2) authorizers. Translates old-style authorize() calls to the new-style, expands Permission.READ and Permission.WRITE into the new Permission values, translates the new resource hierarchy into the old hierarchy. Stubs the rest of the new methods. Subclass LegacyAuthorizer instead of implementing the old IAuthority and your old IAuthority implementation should continue to work.
Constructor Summary | |
---|---|
LegacyAuthorizer()
|
Method Summary | |
---|---|
java.util.Set<Permission> |
authorize(AuthenticatedUser user,
IResource resource)
Translates new-style authorize() method call to the old-style (including permissions and the hierarchy). |
abstract java.util.EnumSet<Permission> |
authorize(AuthenticatedUser user,
java.util.List<java.lang.Object> resource)
|
void |
grant(AuthenticatedUser performer,
java.util.Set<Permission> permissions,
IResource resource,
java.lang.String to)
Grants a set of permissions on a resource to a user. |
java.util.Set<PermissionDetails> |
list(AuthenticatedUser performer,
java.util.Set<Permission> permissions,
IResource resource,
java.lang.String of)
Returns a list of permissions on a resource of a user. |
java.util.Set<IResource> |
protectedResources()
Set of resources that should be made inaccessible to users and only accessible internally. |
void |
revoke(AuthenticatedUser performer,
java.util.Set<Permission> permissions,
IResource resource,
java.lang.String from)
Revokes a set of permissions on a resource from a user. |
void |
revokeAll(IResource droppedResource)
This method is called after a resource is removed (i.e. |
void |
revokeAll(java.lang.String droppedUser)
This method is called before deleting a user with DROP USER query so that a new user with the same name wouldn't inherit permissions of the deleted user in the future. |
void |
setup()
Setup is called once upon system startup to initialize the IAuthorizer. |
abstract void |
validateConfiguration()
Validates configuration of IAuthorizer implementation (if configurable). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LegacyAuthorizer()
Method Detail |
---|
public abstract java.util.EnumSet<Permission> authorize(AuthenticatedUser user, java.util.List<java.lang.Object> resource)
user
- Authenticated user requesting authorization.resource
- List of Objects containing Strings and byte[]s: represents a resource in the old hierarchy.
public abstract void validateConfiguration() throws ConfigurationException
IAuthorizer
validateConfiguration
in interface IAuthorizer
ConfigurationException
- when there is a configuration error.public java.util.Set<Permission> authorize(AuthenticatedUser user, IResource resource)
authorize
in interface IAuthorizer
user
- Authenticated user requesting authorization.resource
- Resource for which the authorization is being requested. @see DataResource.
public void grant(AuthenticatedUser performer, java.util.Set<Permission> permissions, IResource resource, java.lang.String to) throws InvalidRequestException, UnauthorizedException
IAuthorizer
grant
in interface IAuthorizer
performer
- User who grants the permissions.permissions
- Set of permissions to grant.resource
- Resource on which to grant the permissions.to
- Grantee of the permissions.
InvalidRequestException
- upon parameter misconfiguration or internal error.
UnauthorizedException
- if the granting user isn't allowed to grant (and revoke) the permissions on the resource.public void revoke(AuthenticatedUser performer, java.util.Set<Permission> permissions, IResource resource, java.lang.String from) throws InvalidRequestException, UnauthorizedException
IAuthorizer
revoke
in interface IAuthorizer
performer
- User who revokes the permissions.permissions
- Set of permissions to revoke.resource
- Resource on which to revoke the permissions.from
- Revokee of the permissions.
InvalidRequestException
- upon parameter misconfiguration or internal error.
UnauthorizedException
- if the revoking user isn't allowed to revoke the permissions on the resource.public void revokeAll(java.lang.String droppedUser)
IAuthorizer
revokeAll
in interface IAuthorizer
droppedUser
- The user to revoke all permissions from.public void revokeAll(IResource droppedResource)
IAuthorizer
revokeAll
in interface IAuthorizer
droppedResource
- The resource to revoke all permissions on.public java.util.Set<PermissionDetails> list(AuthenticatedUser performer, java.util.Set<Permission> permissions, IResource resource, java.lang.String of) throws InvalidRequestException, UnauthorizedException
IAuthorizer
list
in interface IAuthorizer
performer
- User who wants to see the permissions.permissions
- Set of Permission values the user is interested in. The result should only include the matching ones.resource
- The resource on which permissions are requested. Can be null, in which case permissions on all resources
should be returned.of
- The user whose permissions are requested. Can be null, in which case permissions of every user should be returned.
InvalidRequestException
- upon parameter misconfiguration or internal error.
UnauthorizedException
- if the user isn't allowed to view the requested permissions.public java.util.Set<IResource> protectedResources()
IAuthorizer
protectedResources
in interface IAuthorizer
public void setup()
IAuthorizer
setup
in interface IAuthorizer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |