@InterfaceAudience.Private public class AccessControlUtil extends Object
Modifier | Constructor and Description |
---|---|
private |
AccessControlUtil() |
Modifier and Type | Method and Description |
---|---|
static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.GetUserPermissionsResponse |
buildGetUserPermissionsResponse(List<UserPermission> permissions)
Converts the permissions list into a protocol buffer GetUserPermissionsResponse
|
static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.GrantRequest |
buildGrantRequest(String username,
boolean mergeExistingPermissions,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission.Action... actions)
Create a request to grant user global permissions.
|
static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.GrantRequest |
buildGrantRequest(String username,
String namespace,
boolean mergeExistingPermissions,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission.Action... actions)
Create a request to grant user namespace permissions.
|
static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.GrantRequest |
buildGrantRequest(String username,
TableName tableName,
byte[] family,
byte[] qualifier,
boolean mergeExistingPermissions,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission.Action... actions)
Create a request to grant user table permissions.
|
static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.RevokeRequest |
buildRevokeRequest(String username,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission.Action... actions)
Create a request to revoke user global permissions.
|
static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.RevokeRequest |
buildRevokeRequest(String username,
String namespace,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission.Action... actions)
Create a request to revoke user namespace permissions.
|
static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.RevokeRequest |
buildRevokeRequest(String username,
TableName tableName,
byte[] family,
byte[] qualifier,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission.Action... actions)
Create a request to revoke user table permissions.
|
static List<UserPermission> |
getUserPermissions(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol)
Deprecated.
Use
Admin.getUserPermissions(GetUserPermissionsRequest) instead. |
static List<UserPermission> |
getUserPermissions(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
byte[] namespace)
Deprecated.
|
static List<UserPermission> |
getUserPermissions(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
byte[] namespace,
String userName)
Deprecated.
|
static List<UserPermission> |
getUserPermissions(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userName)
Deprecated.
|
static List<UserPermission> |
getUserPermissions(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
TableName t)
Deprecated.
|
static List<UserPermission> |
getUserPermissions(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
TableName t,
byte[] columnFamily,
byte[] columnQualifier,
String userName)
Deprecated.
|
static void |
grant(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userShortName,
boolean mergeExistingPermissions,
Permission.Action... actions)
Deprecated.
|
static void |
grant(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userShortName,
String namespace,
boolean mergeExistingPermissions,
Permission.Action... actions)
Deprecated.
|
static void |
grant(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userShortName,
TableName tableName,
byte[] f,
byte[] q,
boolean mergeExistingPermissions,
Permission.Action... actions)
Deprecated.
|
static boolean |
hasPermission(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
TableName tableName,
byte[] columnFamily,
byte[] columnQualifier,
String userName,
Permission.Action[] actions)
Deprecated.
|
static void |
revoke(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userShortName,
Permission.Action... actions)
Deprecated.
Use
Admin.revoke(UserPermission) instead. |
static void |
revoke(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userShortName,
String namespace,
Permission.Action... actions)
Deprecated.
Use
Admin.revoke(UserPermission) instead. |
static void |
revoke(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userShortName,
TableName tableName,
byte[] f,
byte[] q,
Permission.Action... actions)
Deprecated.
Use
Admin.revoke(UserPermission) instead. |
static Permission |
toPermission(org.apache.hadoop.hbase.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.protobuf.generated.AccessControlProtos.UsersAndPermissions proto)
Convert a protobuf UserTablePermissions to a ListMultimap<Username, Permission>
|
static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission |
toPermission(Permission perm)
Convert a client Permission to a Permission proto
|
static Permission.Action |
toPermissionAction(org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission.Action action)
Converts a Permission.Action proto to a client Permission.Action object.
|
static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission.Action |
toPermissionAction(Permission.Action action)
Convert a client Permission.Action to a Permission.Action proto
|
static Permission.Action[] |
toPermissionActions(List<org.apache.hadoop.hbase.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.protobuf.generated.AccessControlProtos.TablePermission proto)
Converts a TablePermission proto to a client TablePermission object.
|
static UserPermission |
toUserPermission(org.apache.hadoop.hbase.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.protobuf.generated.AccessControlProtos.UsersAndPermissions proto)
Convert a protobuf UserTablePermissions to a ListMultimap<Username, UserPermission>
|
static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UserPermission |
toUserPermission(UserPermission perm)
Convert a client user permission to a user permission proto
|
static org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap<String,Permission> |
toUsersAndPermissions(org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UsersAndPermissions proto) |
static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UsersAndPermissions |
toUsersAndPermissions(org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap<String,Permission> perms) |
static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UsersAndPermissions |
toUsersAndPermissions(String user,
Permission perms) |
static org.apache.hadoop.hbase.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
|
private AccessControlUtil()
public static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.GrantRequest buildGrantRequest(String username, TableName tableName, byte[] family, byte[] qualifier, boolean mergeExistingPermissions, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission.Action... actions)
username
- the short user name who to grant permissionstableName
- optional table name the permissions applyfamily
- optional column familyqualifier
- optional qualifieractions
- the permissions to be grantedAccessControlProtos
GrantRequestpublic static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.GrantRequest buildGrantRequest(String username, String namespace, boolean mergeExistingPermissions, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission.Action... actions)
username
- the short user name who to grant permissionsnamespace
- optional table name the permissions applyactions
- the permissions to be grantedAccessControlProtos
GrantRequestpublic static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.RevokeRequest buildRevokeRequest(String username, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission.Action... actions)
username
- the short user name whose permissions to be revokedactions
- the permissions to be revokedAccessControlProtos
RevokeRequestpublic static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.RevokeRequest buildRevokeRequest(String username, String namespace, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission.Action... actions)
username
- the short user name whose permissions to be revokednamespace
- optional table name the permissions applyactions
- the permissions to be revokedAccessControlProtos
RevokeRequestpublic static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.GrantRequest buildGrantRequest(String username, boolean mergeExistingPermissions, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission.Action... actions)
username
- the short user name who to grant permissionsactions
- the permissions to be grantedAccessControlProtos
GrantRequestpublic static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UsersAndPermissions toUsersAndPermissions(String user, Permission perms)
public static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UsersAndPermissions toUsersAndPermissions(org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap<String,Permission> perms)
public static org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap<String,Permission> toUsersAndPermissions(org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UsersAndPermissions proto)
public static TablePermission toTablePermission(org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.TablePermission proto)
proto
- the protobuf TablePermissionpublic static Permission toPermission(org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission proto)
proto
- the protobuf Permissionpublic static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission toPermission(Permission perm)
perm
- the client Permissionpublic static Permission.Action[] toPermissionActions(List<org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission.Action> protoActions)
protoActions
- the list of protobuf Actionspublic static Permission.Action toPermissionAction(org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission.Action action)
action
- the protobuf Actionpublic static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission.Action toPermissionAction(Permission.Action action)
action
- the client Actionpublic static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UserPermission toUserPermission(UserPermission perm)
perm
- the client UserPermissionpublic static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.GetUserPermissionsResponse buildGetUserPermissionsResponse(List<UserPermission> permissions)
public static UserPermission toUserPermission(org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UserPermission proto)
proto
- the protobuf UserPermissionpublic static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UsersAndPermissions toUserTablePermissions(org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap<String,UserPermission> perm)
perm
- the list of user and table permissions@Deprecated public static void grant(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, String userShortName, boolean mergeExistingPermissions, Permission.Action... actions) throws com.google.protobuf.ServiceException
It's also called by the shell, in case you want to find references.
protocol
- the AccessControlService protocol proxyuserShortName
- the short name of the user to grant permissionsactions
- the permissions to be granted n * @deprecated Use
Admin.grant(UserPermission, boolean)
instead.com.google.protobuf.ServiceException
@Deprecated public static void grant(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, String userShortName, TableName tableName, byte[] f, byte[] q, boolean mergeExistingPermissions, Permission.Action... actions) throws com.google.protobuf.ServiceException
It's also called by the shell, in case you want to find references.
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 n * @deprecated Use
Admin.grant(UserPermission, boolean)
instead.com.google.protobuf.ServiceException
@Deprecated public static void grant(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, String userShortName, String namespace, boolean mergeExistingPermissions, Permission.Action... actions) throws com.google.protobuf.ServiceException
It's also called by the shell, in case you want to find references.
controller
- RpcControllerprotocol
- the AccessControlService protocol proxynamespace
- the short name of the user to grant permissionsactions
- the permissions to be granted n * @deprecated Use
Admin.grant(UserPermission, boolean)
instead.com.google.protobuf.ServiceException
@Deprecated public static void revoke(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, String userShortName, Permission.Action... actions) throws com.google.protobuf.ServiceException
Admin.revoke(UserPermission)
instead.It's also called by the shell, in case you want to find references.
controller
- RpcControllerprotocol
- the AccessControlService protocol proxyuserShortName
- the short name of the user to revoke permissionsactions
- the permissions to be revokedcom.google.protobuf.ServiceException
- on failure@Deprecated public static void revoke(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, String userShortName, TableName tableName, byte[] f, byte[] q, Permission.Action... actions) throws com.google.protobuf.ServiceException
Admin.revoke(UserPermission)
instead.It's also called by the shell, in case you want to find references.
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 revokedcom.google.protobuf.ServiceException
- on failure@Deprecated public static void revoke(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, String userShortName, String namespace, Permission.Action... actions) throws com.google.protobuf.ServiceException
Admin.revoke(UserPermission)
instead.It's also called by the shell, in case you want to find references.
controller
- RpcControllerprotocol
- the AccessControlService protocol proxyuserShortName
- the short name of the user to revoke permissionsnamespace
- optional table nameactions
- the permissions to be revokedcom.google.protobuf.ServiceException
- on failure@Deprecated public static List<UserPermission> getUserPermissions(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol) throws com.google.protobuf.ServiceException
Admin.getUserPermissions(GetUserPermissionsRequest)
instead.It's also called by the shell, in case you want to find references.
controller
- RpcControllerprotocol
- the AccessControlService protocol proxycom.google.protobuf.ServiceException
- on failure@Deprecated public static List<UserPermission> getUserPermissions(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, String userName) throws com.google.protobuf.ServiceException
controller
- RpcControllerprotocol
- the AccessControlService protocol proxyuserName
- User name, if empty then all user permissions will be retrieved. n
* @deprecated Use Admin.getUserPermissions(GetUserPermissionsRequest)
instead.com.google.protobuf.ServiceException
@Deprecated public static List<UserPermission> getUserPermissions(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, TableName t) throws com.google.protobuf.ServiceException
It's also called by the shell, in case you want to find references.
controller
- RpcControllerprotocol
- the AccessControlService protocol proxyt
- optional table name n * @deprecated Use
Admin.getUserPermissions(GetUserPermissionsRequest)
instead.com.google.protobuf.ServiceException
@Deprecated public static List<UserPermission> getUserPermissions(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, TableName t, byte[] columnFamily, byte[] columnQualifier, String userName) throws com.google.protobuf.ServiceException
controller
- RpcControllerprotocol
- the AccessControlService protocol proxyt
- optional table namecolumnFamily
- Column familycolumnQualifier
- Column qualifieruserName
- User name, if empty then all user permissions will be retrieved. n
* @deprecated Use
Admin.getUserPermissions(GetUserPermissionsRequest)
instead.com.google.protobuf.ServiceException
@Deprecated public static List<UserPermission> getUserPermissions(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, byte[] namespace) throws com.google.protobuf.ServiceException
It's also called by the shell, in case you want to find references.
controller
- RpcControllerprotocol
- the AccessControlService protocol proxynamespace
- name of the namespace n * @deprecated Use
Admin.getUserPermissions(GetUserPermissionsRequest)
instead.com.google.protobuf.ServiceException
@Deprecated public static List<UserPermission> getUserPermissions(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, byte[] namespace, String userName) throws com.google.protobuf.ServiceException
controller
- RpcControllerprotocol
- the AccessControlService protocol proxynamespace
- name of the namespaceuserName
- User name, if empty then all user permissions will be retrieved. n
* @deprecated Use Admin.getUserPermissions(GetUserPermissionsRequest)
instead.com.google.protobuf.ServiceException
@Deprecated public static boolean hasPermission(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface protocol, TableName tableName, byte[] columnFamily, byte[] columnQualifier, String userName, Permission.Action[] actions) throws com.google.protobuf.ServiceException
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
- ActionsAdmin.hasUserPermissions(String, List)
instead.com.google.protobuf.ServiceException
public static org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap<String,UserPermission> toUserPermission(org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UsersAndPermissions proto)
proto
- the proto UsersAndPermissionspublic static org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap<String,Permission> toPermission(org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.UsersAndPermissions proto)
proto
- the proto UsersAndPermissionspublic static org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.RevokeRequest buildRevokeRequest(String username, TableName tableName, byte[] family, byte[] qualifier, org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.Permission.Action... actions)
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 revokedAccessControlProtos
RevokeRequestCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.