public abstract class AbstractAuthorizer extends Object implements Authorizer
Authorizer and provides default no-op implementations of
Authorizer.initialize(AuthorizationContext) and Authorizer.destroy() so classes extending it do not
have to implement these methods unless necessary.| Modifier and Type | Field and Description |
|---|---|
protected static Predicate<EntityId> |
ALLOW_ALL |
| Constructor and Description |
|---|
AbstractAuthorizer() |
| Modifier and Type | Method and Description |
|---|---|
Predicate<EntityId> |
createFilter(Principal principal)
|
void |
destroy()
Default no-op implementation of
Authorizer.destroy(). |
void |
enforce(EntityId entity,
Principal principal,
Action action)
|
void |
initialize(AuthorizationContext context)
Default no-op implementation of
Authorizer.initialize(AuthorizationContext). |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddRoleToPrincipal, createRole, dropRole, listAllRoles, listRoles, removeRoleFromPrincipallistPrivilegesgrant, revoke, revokeenforcepublic void initialize(AuthorizationContext context) throws Exception
Authorizer.initialize(AuthorizationContext).initialize in interface Authorizercontext - the AuthorizationContext that can be used to interact with CDAPExceptionpublic void destroy()
throws Exception
Authorizer.destroy().destroy in interface AuthorizerExceptionpublic void enforce(EntityId entity, Principal principal, Action action) throws Exception
AuthorizationEnforcerPrincipal for the specified Action on the specified
EntityId.enforce in interface AuthorizationEnforcerentity - the EntityId on which authorization is to be enforcedprincipal - the Principal that performs the actionaction - the Action being performedUnauthorizedException - if the principal is not authorized to perform the specified action on the entityException - if any other errors occurred while performing the authorization enforcement checkpublic Predicate<EntityId> createFilter(Principal principal) throws Exception
AuthorizationEnforcerPredicate that can be used to filter a set of entities to only return the entities that the
specified Principal has access (READ/WRITE/ADMIN/ALL) to.createFilter in interface AuthorizationEnforcerprincipal - the Principal for which to filterentities that the specified user has access toExceptionCopyright © 2017 Cask Data, Inc. Licensed under the Apache License, Version 2.0.