org.apache.hadoop.hbase.security.access
Class AccessControlClient

java.lang.Object
  extended by org.apache.hadoop.hbase.security.access.AccessControlClient

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class AccessControlClient
extends Object

Utility client for doing access control admin operations.


Field Summary
static TableName ACL_TABLE_NAME
           
 
Constructor Summary
AccessControlClient()
           
 
Method Summary
static List<UserPermission> getUserPermissions(org.apache.hadoop.conf.Configuration conf, String tableRegex)
          List all the userPermissions matching the given pattern.
static void grant(org.apache.hadoop.conf.Configuration conf, String userName, Permission.Action... actions)
          Grant global permissions for the specified user.
static void grant(org.apache.hadoop.conf.Configuration conf, String namespace, String userName, Permission.Action... actions)
          Grants permission on the specified namespace for the specified user.
static AccessControlProtos.GrantResponse grant(org.apache.hadoop.conf.Configuration conf, TableName tableName, String userName, byte[] family, byte[] qual, AccessControlProtos.Permission.Action... actions)
          Deprecated. Use grant(Configuration, TableName, String, byte[], byte[], Permission.Action...) instead.
static void grant(org.apache.hadoop.conf.Configuration conf, TableName tableName, String userName, byte[] family, byte[] qual, Permission.Action... actions)
          Grants permission on the specified table for the specified user
static boolean isAccessControllerRunning(org.apache.hadoop.conf.Configuration conf)
           
static void revoke(org.apache.hadoop.conf.Configuration conf, String userName, Permission.Action... actions)
          Revoke global permissions for the specified user.
static void revoke(org.apache.hadoop.conf.Configuration conf, String namespace, String userName, Permission.Action... actions)
          Revokes the permission on the table for the specified user.
static AccessControlProtos.RevokeResponse revoke(org.apache.hadoop.conf.Configuration conf, String username, TableName tableName, byte[] family, byte[] qualifier, AccessControlProtos.Permission.Action... actions)
          Deprecated. Use revoke(Configuration, TableName, String, byte[], byte[], Permission.Action...) instead
static void revoke(org.apache.hadoop.conf.Configuration conf, TableName tableName, String username, byte[] family, byte[] qualifier, Permission.Action... actions)
          Revokes the permission on the table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACL_TABLE_NAME

public static final TableName ACL_TABLE_NAME
Constructor Detail

AccessControlClient

public AccessControlClient()
Method Detail

grant

public static void grant(org.apache.hadoop.conf.Configuration conf,
                         TableName tableName,
                         String userName,
                         byte[] family,
                         byte[] qual,
                         Permission.Action... actions)
                  throws Throwable
Grants permission on the specified table for the specified user

Parameters:
conf -
tableName -
userName -
family -
qual -
actions -
Throws:
Throwable

grant

public static void grant(org.apache.hadoop.conf.Configuration conf,
                         String namespace,
                         String userName,
                         Permission.Action... actions)
                  throws Throwable
Grants permission on the specified namespace for the specified user.

Parameters:
conf -
namespace -
userName -
actions -
Throws:
Throwable

grant

public static void grant(org.apache.hadoop.conf.Configuration conf,
                         String userName,
                         Permission.Action... actions)
                  throws Throwable
Grant global permissions for the specified user.

Throws:
Throwable

isAccessControllerRunning

public static boolean isAccessControllerRunning(org.apache.hadoop.conf.Configuration conf)
                                         throws MasterNotRunningException,
                                                ZooKeeperConnectionException,
                                                IOException
Throws:
MasterNotRunningException
ZooKeeperConnectionException
IOException

revoke

public static void revoke(org.apache.hadoop.conf.Configuration conf,
                          TableName tableName,
                          String username,
                          byte[] family,
                          byte[] qualifier,
                          Permission.Action... actions)
                   throws Throwable
Revokes the permission on the table

Parameters:
conf -
tableName -
username -
family -
qualifier -
actions -
Throws:
Throwable

revoke

public static void revoke(org.apache.hadoop.conf.Configuration conf,
                          String namespace,
                          String userName,
                          Permission.Action... actions)
                   throws Throwable
Revokes the permission on the table for the specified user.

Parameters:
conf -
namespace -
userName -
actions -
Throws:
Throwable

revoke

public static void revoke(org.apache.hadoop.conf.Configuration conf,
                          String userName,
                          Permission.Action... actions)
                   throws Throwable
Revoke global permissions for the specified user.

Throws:
Throwable

getUserPermissions

public static List<UserPermission> getUserPermissions(org.apache.hadoop.conf.Configuration conf,
                                                      String tableRegex)
                                               throws Throwable
List all the userPermissions matching the given pattern.

Parameters:
conf -
tableRegex - The regular expression string to match against
Returns:
- returns an array of UserPermissions
Throws:
Throwable

grant

@Deprecated
public static AccessControlProtos.GrantResponse grant(org.apache.hadoop.conf.Configuration conf,
                                                                 TableName tableName,
                                                                 String userName,
                                                                 byte[] family,
                                                                 byte[] qual,
                                                                 AccessControlProtos.Permission.Action... actions)
                                               throws Throwable
Deprecated. Use grant(Configuration, TableName, String, byte[], byte[], Permission.Action...) instead.

Grants permission on the specified table for the specified user

Parameters:
conf -
tableName -
userName -
family -
qual -
actions -
Returns:
GrantResponse
Throws:
Throwable

revoke

@Deprecated
public static AccessControlProtos.RevokeResponse revoke(org.apache.hadoop.conf.Configuration conf,
                                                                   String username,
                                                                   TableName tableName,
                                                                   byte[] family,
                                                                   byte[] qualifier,
                                                                   AccessControlProtos.Permission.Action... actions)
                                                 throws Throwable
Deprecated. Use revoke(Configuration, TableName, String, byte[], byte[], Permission.Action...) instead

Revokes the permission on the table

Parameters:
conf -
username -
tableName -
family -
qualifier -
actions -
Returns:
RevokeResponse
Throws:
Throwable


Copyright © 2015 The Apache Software Foundation. All Rights Reserved.