@InterfaceAudience.LimitedPrivate(value="Coprocesssor") @InterfaceStability.Evolving public final class AccessChecker extends Object
Constructor and Description |
---|
AccessChecker(org.apache.hadoop.conf.Configuration conf,
ZooKeeperWatcher zkw)
Constructor with existing configuration
|
Modifier and Type | Method and Description |
---|---|
TableAuthManager |
getAuthManager() |
static boolean |
isAuthorizationSupported(org.apache.hadoop.conf.Configuration conf) |
void |
logResult(AuthResult result) |
void |
requireAccess(User user,
String request,
TableName tableName,
Permission.Action... permissions)
Authorizes that the current user has any of the given permissions to access the table.
|
void |
requireGlobalPermission(User user,
String request,
Permission.Action perm,
String namespace)
Checks that the user has the given global permission.
|
void |
requireGlobalPermission(User user,
String request,
Permission.Action perm,
TableName tableName,
Map<byte[],? extends Collection<byte[]>> familyMap)
Checks that the user has the given global permission.
|
void |
requireNamespacePermission(User user,
String request,
String namespace,
Permission.Action... permissions)
Checks that the user has the given global or namespace permission.
|
void |
requireNamespacePermission(User user,
String request,
String namespace,
TableName tableName,
Map<byte[],? extends Collection<byte[]>> familyMap,
Permission.Action... permissions)
Checks that the user has the given global or namespace permission.
|
void |
requirePermission(User user,
String request,
Permission.Action perm)
Authorizes that the current user has global privileges for the given action.
|
void |
requirePermission(User user,
String request,
TableName tableName,
byte[] family,
byte[] qualifier,
Permission.Action... permissions)
Authorizes that the current user has any of the given permissions for the
given table, column family and column qualifier.
|
void |
requireTablePermission(User user,
String request,
TableName tableName,
byte[] family,
byte[] qualifier,
Permission.Action... permissions)
Authorizes that the current user has any of the given permissions for the
given table, column family and column qualifier.
|
public AccessChecker(org.apache.hadoop.conf.Configuration conf, ZooKeeperWatcher zkw) throws RuntimeException
conf
- Existing configuration to usezkw
- reference to the ZooKeeperWatcher
RuntimeException
public static boolean isAuthorizationSupported(org.apache.hadoop.conf.Configuration conf)
public TableAuthManager getAuthManager()
public void logResult(AuthResult result)
public void requirePermission(User user, String request, TableName tableName, byte[] family, byte[] qualifier, Permission.Action... permissions) throws IOException
tableName
- Table requestedfamily
- Column family requestedqualifier
- Column qualifier requestedIOException
- if obtaining the current user failsAccessDeniedException
- if user has no authorizationpublic void requireTablePermission(User user, String request, TableName tableName, byte[] family, byte[] qualifier, Permission.Action... permissions) throws IOException
tableName
- Table requestedfamily
- Column family paramqualifier
- Column qualifier paramIOException
- if obtaining the current user failsAccessDeniedException
- if user has no authorizationpublic void requireAccess(User user, String request, TableName tableName, Permission.Action... permissions) throws IOException
tableName
- Table requestedpermissions
- Actions being requestedIOException
- if obtaining the current user failsAccessDeniedException
- if user has no authorizationpublic void requirePermission(User user, String request, Permission.Action perm) throws IOException
perm
- The action being requestedIOException
- if obtaining the current user failsAccessDeniedException
- if authorization is deniedpublic void requireGlobalPermission(User user, String request, Permission.Action perm, TableName tableName, Map<byte[],? extends Collection<byte[]>> familyMap) throws IOException
perm
- Action being requestedtableName
- Affected table name.familyMap
- Affected column families.IOException
public void requireGlobalPermission(User user, String request, Permission.Action perm, String namespace) throws IOException
perm
- Action being requestednamespace
- The given namespaceIOException
public void requireNamespacePermission(User user, String request, String namespace, Permission.Action... permissions) throws IOException
namespace
- The given namespacepermissions
- Actions being requestedIOException
public void requireNamespacePermission(User user, String request, String namespace, TableName tableName, Map<byte[],? extends Collection<byte[]>> familyMap, Permission.Action... permissions) throws IOException
namespace
- The given namespacepermissions
- Actions being requestedIOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.