@InterfaceAudience.Public public class AccessControlClient extends Object
| Modifier and Type | Field and Description |
|---|---|
static TableName |
ACL_TABLE_NAME |
| Constructor and Description |
|---|
AccessControlClient() |
| Modifier and Type | Method and Description |
|---|---|
private static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface |
getAccessControlServiceStub(Table ht) |
static List<UserPermission> |
getUserPermissions(Connection connection,
String tableRegex)
List all the userPermissions matching the given pattern.
|
private static void |
grant(Connection connection,
String userName,
boolean mergeExistingPermissions,
Permission.Action... actions)
Grants permission on the specified namespace for the specified user.
|
static void |
grant(Connection connection,
String userName,
Permission.Action... actions)
Grant global permissions for the specified user.
|
private static void |
grant(Connection connection,
String namespace,
String userName,
boolean mergeExistingPermissions,
Permission.Action... actions)
Grants permission on the specified namespace for the specified user.
|
static void |
grant(Connection connection,
String namespace,
String userName,
Permission.Action... actions)
Grants permission on the specified namespace for the specified user.
|
private static void |
grant(Connection connection,
TableName tableName,
String userName,
byte[] family,
byte[] qual,
boolean mergeExistingPermissions,
Permission.Action... actions)
Grants permission on the specified table for the specified user
|
static void |
grant(Connection connection,
TableName tableName,
String userName,
byte[] family,
byte[] qual,
Permission.Action... actions)
Grants permission on the specified table for the specified user.
|
static boolean |
isAccessControllerRunning(Connection connection) |
static boolean |
isAuthorizationEnabled(Connection connection)
Return true if authorization is supported and enabled
|
static boolean |
isCellAuthorizationEnabled(Connection connection)
Return true if cell authorization is supported and enabled
|
static void |
revoke(Connection connection,
String userName,
Permission.Action... actions)
Revoke global permissions for the specified user.
|
static void |
revoke(Connection connection,
String namespace,
String userName,
Permission.Action... actions)
Revokes the permission on the table for the specified user.
|
static void |
revoke(Connection connection,
TableName tableName,
String username,
byte[] family,
byte[] qualifier,
Permission.Action... actions)
Revokes the permission on the table
|
public static final TableName ACL_TABLE_NAME
public AccessControlClient()
public static boolean isAuthorizationEnabled(Connection connection) throws IOException
connection - The connection to useIOExceptionpublic static boolean isCellAuthorizationEnabled(Connection connection) throws IOException
connection - The connection to useIOExceptionprivate static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface getAccessControlServiceStub(Table ht) throws IOException
IOExceptionprivate static void grant(Connection connection, TableName tableName, String userName, byte[] family, byte[] qual, boolean mergeExistingPermissions, Permission.Action... actions) throws Throwable
connection - The Connection instance to usetableName - userName - family - qual - mergeExistingPermissions - If set to false, later granted permissions will override
previous granted permissions. otherwise, it'll merge with previous granted
permissions.actions - Throwablepublic static void grant(Connection connection, TableName tableName, String userName, byte[] family, byte[] qual, Permission.Action... actions) throws Throwable
connection - The Connection instance to usetableName - userName - family - qual - actions - Throwableprivate static void grant(Connection connection, String namespace, String userName, boolean mergeExistingPermissions, Permission.Action... actions) throws Throwable
connection - namespace - userName - mergeExistingPermissions - If set to false, later granted permissions will override
previous granted permissions. otherwise, it'll merge with previous granted
permissions.actions - Throwablepublic static void grant(Connection connection, String namespace, String userName, Permission.Action... actions) throws Throwable
connection - The Connection instance to usenamespace - userName - actions - Throwableprivate static void grant(Connection connection, String userName, boolean mergeExistingPermissions, Permission.Action... actions) throws Throwable
connection - userName - mergeExistingPermissions - If set to false, later granted permissions will override
previous granted permissions. otherwise, it'll merge with previous granted
permissions.actions - Throwablepublic static void grant(Connection connection, String userName, Permission.Action... actions) throws Throwable
connection - userName - actions - Throwablepublic static boolean isAccessControllerRunning(Connection connection) throws MasterNotRunningException, ZooKeeperConnectionException, IOException
public static void revoke(Connection connection, TableName tableName, String username, byte[] family, byte[] qualifier, Permission.Action... actions) throws Throwable
connection - The Connection instance to usetableName - username - family - qualifier - actions - Throwablepublic static void revoke(Connection connection, String namespace, String userName, Permission.Action... actions) throws Throwable
connection - The Connection instance to usenamespace - userName - actions - Throwablepublic static void revoke(Connection connection, String userName, Permission.Action... actions) throws Throwable
connection - The Connection instance to useThrowablepublic static List<UserPermission> getUserPermissions(Connection connection, String tableRegex) throws Throwable
connection - The Connection instance to usetableRegex - The regular expression string to match againstThrowableCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.