Class AccessControlUtil
java.lang.Object
org.apache.hadoop.hbase.security.access.AccessControlUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.GetUserPermissionsResponse
buildGetUserPermissionsResponse
(List<UserPermission> permissions) Converts the permissions list into a protocol buffer GetUserPermissionsResponsestatic org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.GrantRequest
buildGrantRequest
(String username, boolean mergeExistingPermissions, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.Permission.Action... actions) Create a request to grant user global permissions.static org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.GrantRequest
buildGrantRequest
(String username, String namespace, boolean mergeExistingPermissions, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.Permission.Action... actions) Create a request to grant user namespace permissions.static org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.GrantRequest
buildGrantRequest
(String username, TableName tableName, byte[] family, byte[] qualifier, boolean mergeExistingPermissions, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.Permission.Action... actions) Create a request to grant user table permissions.static org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.RevokeRequest
buildRevokeRequest
(String username, String namespace, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.Permission.Action... actions) Create a request to revoke user namespace permissions.static org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.RevokeRequest
buildRevokeRequest
(String username, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.Permission.Action... actions) Create a request to revoke user global permissions.static org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.RevokeRequest
buildRevokeRequest
(String username, TableName tableName, byte[] family, byte[] qualifier, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.Permission.Action... actions) Create a request to revoke user table permissions.static List<UserPermission>
getUserPermissions
(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol) Deprecated.static List<UserPermission>
getUserPermissions
(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, byte[] namespace) Deprecated.UseAdmin.getUserPermissions(GetUserPermissionsRequest)
instead.static List<UserPermission>
getUserPermissions
(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, byte[] namespace, String userName) Deprecated.UseAdmin.getUserPermissions(GetUserPermissionsRequest)
instead.static List<UserPermission>
getUserPermissions
(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, String userName) Deprecated.UseAdmin.getUserPermissions(GetUserPermissionsRequest)
instead.static List<UserPermission>
getUserPermissions
(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, TableName t) Deprecated.UseAdmin.getUserPermissions(GetUserPermissionsRequest)
instead.static List<UserPermission>
getUserPermissions
(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, TableName t, byte[] columnFamily, byte[] columnQualifier, String userName) Deprecated.UseAdmin.getUserPermissions(GetUserPermissionsRequest)
instead.static void
grant
(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, String userShortName, boolean mergeExistingPermissions, Permission.Action... actions) Deprecated.UseAdmin.grant(UserPermission, boolean)
instead.static void
grant
(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, String userShortName, String namespace, boolean mergeExistingPermissions, Permission.Action... actions) Deprecated.UseAdmin.grant(UserPermission, boolean)
instead.static void
grant
(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, String userShortName, TableName tableName, byte[] f, byte[] q, boolean mergeExistingPermissions, Permission.Action... actions) Deprecated.UseAdmin.grant(UserPermission, boolean)
instead.static boolean
hasPermission
(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, TableName tableName, byte[] columnFamily, byte[] columnQualifier, String userName, Permission.Action[] actions) Deprecated.UseAdmin.hasUserPermissions(String, List)
instead.static void
revoke
(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, String userShortName, String namespace, Permission.Action... actions) Deprecated.UseAdmin.revoke(UserPermission)
instead.static void
revoke
(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, String userShortName, Permission.Action... actions) Deprecated.UseAdmin.revoke(UserPermission)
instead.static void
revoke
(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, String userShortName, TableName tableName, byte[] f, byte[] q, Permission.Action... actions) Deprecated.UseAdmin.revoke(UserPermission)
instead.static org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.Permission
toPermission
(Permission perm) Convert a client Permission to a Permission protostatic Permission
toPermission
(org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.Permission proto) Converts a Permission proto to a client Permission object.static org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap<String,
Permission> toPermission
(org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.UsersAndPermissions proto) Convert a protobuf UserTablePermissions to a ListMultimap<Username, Permission>static org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.Permission.Action
toPermissionAction
(Permission.Action action) Convert a client Permission.Action to a Permission.Action protostatic Permission.Action
toPermissionAction
(org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.Permission.Action action) Converts a Permission.Action proto to a client Permission.Action object.static Permission.Action[]
toPermissionActions
(List<org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.Permission.Action> protoActions) Converts a list of Permission.Action proto to an array of client Permission.Action objects.static TablePermission
toTablePermission
(org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.TablePermission proto) Converts a TablePermission proto to a client TablePermission object.static org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.UserPermission
Convert a client user permission to a user permission protostatic UserPermission
toUserPermission
(org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.UserPermission proto) Converts a user permission proto to a client user permission object.static org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap<String,
UserPermission> toUserPermission
(org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.UsersAndPermissions proto) Convert a protobuf UserTablePermissions to a ListMultimap<Username, UserPermission>static org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.UsersAndPermissions
toUsersAndPermissions
(String user, Permission perms) static org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap<String,
Permission> toUsersAndPermissions
(org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.UsersAndPermissions proto) static org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.UsersAndPermissions
toUsersAndPermissions
(org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap<String, Permission> perms) static org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.UsersAndPermissions
toUserTablePermissions
(org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap<String, UserPermission> perm) Convert a ListMultimap<String, TablePermission> where key is username to a protobuf UserPermission
-
Constructor Details
-
AccessControlUtil
private AccessControlUtil()
-
-
Method Details
-
buildGrantRequest
public static org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.GrantRequest buildGrantRequest(String username, TableName tableName, byte[] family, byte[] qualifier, boolean mergeExistingPermissions, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.Permission.Action... actions) Create a request to grant user table permissions.- Parameters:
username
- the short user name who to grant permissionstableName
- optional table name the permissions applyfamily
- optional column familyqualifier
- optional qualifieractions
- the permissions to be granted- Returns:
- A
AccessControlProtos
GrantRequest - Throws:
NullPointerException
- iftableName
isnull
-
buildGrantRequest
public static org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.GrantRequest buildGrantRequest(String username, String namespace, boolean mergeExistingPermissions, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.Permission.Action... actions) Create a request to grant user namespace permissions.- Parameters:
username
- the short user name who to grant permissionsnamespace
- optional table name the permissions applyactions
- the permissions to be granted- Returns:
- A
AccessControlProtos
GrantRequest
-
buildRevokeRequest
public static org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.RevokeRequest buildRevokeRequest(String username, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.Permission.Action... actions) Create a request to revoke user global permissions.- Parameters:
username
- the short user name whose permissions to be revokedactions
- the permissions to be revoked- Returns:
- A
AccessControlProtos
RevokeRequest
-
buildRevokeRequest
public static org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.RevokeRequest buildRevokeRequest(String username, String namespace, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.Permission.Action... actions) Create a request to revoke user namespace permissions.- Parameters:
username
- the short user name whose permissions to be revokednamespace
- optional table name the permissions applyactions
- the permissions to be revoked- Returns:
- A
AccessControlProtos
RevokeRequest
-
buildGrantRequest
public static org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.GrantRequest buildGrantRequest(String username, boolean mergeExistingPermissions, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.Permission.Action... actions) Create a request to grant user global permissions.- Parameters:
username
- the short user name who to grant permissionsactions
- the permissions to be granted- Returns:
- A
AccessControlProtos
GrantRequest
-
toUsersAndPermissions
public static org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.UsersAndPermissions toUsersAndPermissions(String user, Permission perms) -
toUsersAndPermissions
public static org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.UsersAndPermissions toUsersAndPermissions(org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap<String, Permission> perms) -
toUsersAndPermissions
public static org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap<String,Permission> toUsersAndPermissions(org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.UsersAndPermissions proto) -
toTablePermission
public static TablePermission toTablePermission(org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.TablePermission proto) Converts a TablePermission proto to a client TablePermission object.- Parameters:
proto
- the protobuf TablePermission- Returns:
- the converted TablePermission
-
toPermission
public static Permission toPermission(org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.Permission proto) Converts a Permission proto to a client Permission object.- Parameters:
proto
- the protobuf Permission- Returns:
- the converted Permission
-
toPermission
public static org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.Permission toPermission(Permission perm) Convert a client Permission to a Permission proto- Parameters:
perm
- the client Permission- Returns:
- the protobuf Permission
-
toPermissionActions
public static Permission.Action[] toPermissionActions(List<org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.Permission.Action> protoActions) Converts a list of Permission.Action proto to an array of client Permission.Action objects.- Parameters:
protoActions
- the list of protobuf Actions- Returns:
- the converted array of Actions
-
toPermissionAction
public static Permission.Action toPermissionAction(org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.Permission.Action action) Converts a Permission.Action proto to a client Permission.Action object.- Parameters:
action
- the protobuf Action- Returns:
- the converted Action
-
toPermissionAction
public static org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.Permission.Action toPermissionAction(Permission.Action action) Convert a client Permission.Action to a Permission.Action proto- Parameters:
action
- the client Action- Returns:
- the protobuf Action
-
toUserPermission
public static org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.UserPermission toUserPermission(UserPermission perm) Convert a client user permission to a user permission proto- Parameters:
perm
- the client UserPermission- Returns:
- the protobuf UserPermission
-
buildGetUserPermissionsResponse
public static org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.GetUserPermissionsResponse buildGetUserPermissionsResponse(List<UserPermission> permissions) Converts the permissions list into a protocol buffer GetUserPermissionsResponse -
toUserPermission
public static UserPermission toUserPermission(org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.UserPermission proto) Converts a user permission proto to a client user permission object.- Parameters:
proto
- the protobuf UserPermission- Returns:
- the converted UserPermission
-
toUserTablePermissions
public static org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.UsersAndPermissions toUserTablePermissions(org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap<String, UserPermission> perm) Convert a ListMultimap<String, TablePermission> where key is username to a protobuf UserPermission- Parameters:
perm
- the list of user and table permissions- Returns:
- the protobuf UserTablePermissions
-
grant
@Deprecated public static void grant(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, String userShortName, boolean mergeExistingPermissions, Permission.Action... actions) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException Deprecated.UseAdmin.grant(UserPermission, boolean)
instead.A utility used to grant a user global permissions.It's also called by the shell, in case you want to find references.
- Parameters:
protocol
- the AccessControlService protocol proxyuserShortName
- the short name of the user to grant permissionsactions
- the permissions to be granted- Throws:
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
-
grant
@Deprecated public static void grant(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, String userShortName, TableName tableName, byte[] f, byte[] q, boolean mergeExistingPermissions, Permission.Action... actions) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException Deprecated.UseAdmin.grant(UserPermission, boolean)
instead.A utility used to grant a user table permissions. The permissions will be for a table table/column family/qualifier.It's also called by the shell, in case you want to find references.
- Parameters:
protocol
- the AccessControlService protocol proxyuserShortName
- the short name of the user to grant permissionstableName
- optional table namef
- optional column familyq
- optional qualifieractions
- the permissions to be granted- Throws:
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
-
grant
@Deprecated public static void grant(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, String userShortName, String namespace, boolean mergeExistingPermissions, Permission.Action... actions) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException Deprecated.UseAdmin.grant(UserPermission, boolean)
instead.A utility used to grant a user namespace permissions.It's also called by the shell, in case you want to find references.
- Parameters:
controller
- RpcControllerprotocol
- the AccessControlService protocol proxynamespace
- the short name of the user to grant permissionsactions
- the permissions to be granted- Throws:
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
-
revoke
@Deprecated public static void revoke(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, String userShortName, Permission.Action... actions) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException Deprecated.UseAdmin.revoke(UserPermission)
instead.A utility used to revoke a user's global permissions.It's also called by the shell, in case you want to find references.
- Parameters:
controller
- RpcControllerprotocol
- the AccessControlService protocol proxyuserShortName
- the short name of the user to revoke permissionsactions
- the permissions to be revoked- Throws:
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
- on failure
-
revoke
@Deprecated public static void revoke(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, String userShortName, TableName tableName, byte[] f, byte[] q, Permission.Action... actions) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException Deprecated.UseAdmin.revoke(UserPermission)
instead.A utility used to revoke a user's table permissions. The permissions will be for a table/column family/qualifier.It's also called by the shell, in case you want to find references.
- Parameters:
controller
- RpcControllerprotocol
- the AccessControlService protocol proxyuserShortName
- the short name of the user to revoke permissionstableName
- optional table namef
- optional column familyq
- optional qualifieractions
- the permissions to be revoked- Throws:
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
- on failure
-
revoke
@Deprecated public static void revoke(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, String userShortName, String namespace, Permission.Action... actions) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException Deprecated.UseAdmin.revoke(UserPermission)
instead.A utility used to revoke a user's namespace permissions.It's also called by the shell, in case you want to find references.
- Parameters:
controller
- RpcControllerprotocol
- the AccessControlService protocol proxyuserShortName
- the short name of the user to revoke permissionsnamespace
- optional table nameactions
- the permissions to be revoked- Throws:
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
- on failure
-
getUserPermissions
@Deprecated public static List<UserPermission> getUserPermissions(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException Deprecated.UseAdmin.getUserPermissions(GetUserPermissionsRequest)
instead.A utility used to get user's global permissions.It's also called by the shell, in case you want to find references.
- Parameters:
controller
- RpcControllerprotocol
- the AccessControlService protocol proxy- Throws:
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
- on failure
-
getUserPermissions
@Deprecated public static List<UserPermission> getUserPermissions(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, String userName) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException Deprecated.UseAdmin.getUserPermissions(GetUserPermissionsRequest)
instead.A utility used to get user's global permissions based on the specified user name.- Parameters:
controller
- RpcControllerprotocol
- the AccessControlService protocol proxyuserName
- User name, if empty then all user permissions will be retrieved.- Throws:
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
-
getUserPermissions
@Deprecated public static List<UserPermission> getUserPermissions(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, TableName t) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException Deprecated.UseAdmin.getUserPermissions(GetUserPermissionsRequest)
instead.A utility used to get user table permissions.It's also called by the shell, in case you want to find references.
- Parameters:
controller
- RpcControllerprotocol
- the AccessControlService protocol proxyt
- optional table name- Throws:
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
-
getUserPermissions
@Deprecated public static List<UserPermission> getUserPermissions(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, TableName t, byte[] columnFamily, byte[] columnQualifier, String userName) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException Deprecated.UseAdmin.getUserPermissions(GetUserPermissionsRequest)
instead.A utility used to get user table permissions based on the column family, column qualifier and user name.- Parameters:
controller
- RpcControllerprotocol
- the AccessControlService protocol proxyt
- optional table namecolumnFamily
- Column familycolumnQualifier
- Column qualifieruserName
- User name, if empty then all user permissions will be retrieved.- Throws:
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
-
getUserPermissions
@Deprecated public static List<UserPermission> getUserPermissions(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, byte[] namespace) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException Deprecated.UseAdmin.getUserPermissions(GetUserPermissionsRequest)
instead.A utility used to get permissions for selected namespace.It's also called by the shell, in case you want to find references.
- Parameters:
controller
- RpcControllerprotocol
- the AccessControlService protocol proxynamespace
- name of the namespace- Throws:
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
-
getUserPermissions
@Deprecated public static List<UserPermission> getUserPermissions(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, byte[] namespace, String userName) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException Deprecated.UseAdmin.getUserPermissions(GetUserPermissionsRequest)
instead.A utility used to get permissions for selected namespace based on the specified user name.- Parameters:
controller
- RpcControllerprotocol
- the AccessControlService protocol proxynamespace
- name of the namespaceuserName
- User name, if empty then all user permissions will be retrieved.- Throws:
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
-
hasPermission
@Deprecated public static boolean hasPermission(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, TableName tableName, byte[] columnFamily, byte[] columnQualifier, String userName, Permission.Action[] actions) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException Deprecated.UseAdmin.hasUserPermissions(String, List)
instead.Validates whether specified user has permission to perform actions on the mentioned table, column family or column qualifier.- Parameters:
controller
- RpcControllerprotocol
- the AccessControlService protocol proxytableName
- Table name, it shouldn't be null or empty.columnFamily
- The column family. Optional argument, can be empty. If empty then validation will happen at table level.columnQualifier
- The column qualifier. Optional argument, can be empty. If empty then validation will happen at table and column family level. columnQualifier will not be considered if columnFamily is passed as null or empty.userName
- User name, it shouldn't be null or empty.actions
- Actions- Returns:
- true if access allowed, otherwise false
- Throws:
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
-
toUserPermission
public static org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap<String,UserPermission> toUserPermission(org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.UsersAndPermissions proto) Convert a protobuf UserTablePermissions to a ListMultimap<Username, UserPermission>- Parameters:
proto
- the proto UsersAndPermissions- Returns:
- a ListMultimap with user and its permissions
-
toPermission
public static org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap<String,Permission> toPermission(org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.UsersAndPermissions proto) Convert a protobuf UserTablePermissions to a ListMultimap<Username, Permission>- Parameters:
proto
- the proto UsersAndPermissions- Returns:
- a ListMultimap with user and its permissions
-
buildRevokeRequest
public static org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.RevokeRequest buildRevokeRequest(String username, TableName tableName, byte[] family, byte[] qualifier, org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.Permission.Action... actions) Create a request to revoke user table permissions.- Parameters:
username
- the short user name whose permissions to be revokedtableName
- optional table name the permissions applyfamily
- optional column familyqualifier
- optional qualifieractions
- the permissions to be revoked- Returns:
- A
AccessControlProtos
RevokeRequest
-
Admin.getUserPermissions(GetUserPermissionsRequest)
instead.