@InterfaceAudience.Private public class AccessControlUtil extends Object
Modifier and Type | Method and Description |
---|---|
static AccessControlProtos.GetUserPermissionsResponse |
buildGetUserPermissionsResponse(List<UserPermission> permissions)
Converts the permissions list into a protocol buffer GetUserPermissionsResponse
|
static AccessControlProtos.GrantRequest |
buildGrantRequest(String username,
boolean mergeExistingPermissions,
AccessControlProtos.Permission.Action... actions)
Create a request to grant user permissions.
|
static AccessControlProtos.GrantRequest |
buildGrantRequest(String username,
String namespace,
boolean mergeExistingPermissions,
AccessControlProtos.Permission.Action... actions)
Create a request to grant user permissions.
|
static AccessControlProtos.GrantRequest |
buildGrantRequest(String username,
TableName tableName,
byte[] family,
byte[] qualifier,
boolean mergeExistingPermissions,
AccessControlProtos.Permission.Action... actions)
Create a request to grant user permissions.
|
static AccessControlProtos.RevokeRequest |
buildRevokeRequest(String username,
AccessControlProtos.Permission.Action... actions)
Create a request to revoke user permissions.
|
static AccessControlProtos.RevokeRequest |
buildRevokeRequest(String username,
String namespace,
AccessControlProtos.Permission.Action... actions)
Create a request to revoke user permissions.
|
static AccessControlProtos.RevokeRequest |
buildRevokeRequest(String username,
TableName tableName,
byte[] family,
byte[] qualifier,
AccessControlProtos.Permission.Action... actions)
Create a request to revoke user permissions.
|
static List<UserPermission> |
getUserPermissions(com.google.protobuf.RpcController controller,
AccessControlProtos.AccessControlService.BlockingInterface protocol)
A utility used to get user's global permissions.
|
static List<UserPermission> |
getUserPermissions(com.google.protobuf.RpcController controller,
AccessControlProtos.AccessControlService.BlockingInterface protocol,
byte[] namespace)
A utility used to get permissions for selected namespace.
|
static List<UserPermission> |
getUserPermissions(com.google.protobuf.RpcController controller,
AccessControlProtos.AccessControlService.BlockingInterface protocol,
TableName t)
A utility used to get user table permissions.
|
static void |
grant(com.google.protobuf.RpcController controller,
AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userShortName,
boolean mergeExistingPermissions,
Permission.Action... actions)
A utility used to grant a user global permissions.
|
static void |
grant(com.google.protobuf.RpcController controller,
AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userShortName,
String namespace,
boolean mergeExistingPermissions,
Permission.Action... actions)
A utility used to grant a user namespace permissions.
|
static void |
grant(com.google.protobuf.RpcController controller,
AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userShortName,
TableName tableName,
byte[] f,
byte[] q,
boolean mergeExistingPermissions,
Permission.Action... actions)
A utility used to grant a user table permissions.
|
static void |
revoke(com.google.protobuf.RpcController controller,
AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userShortName,
Permission.Action... actions)
A utility used to revoke a user's global permissions.
|
static void |
revoke(com.google.protobuf.RpcController controller,
AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userShortName,
String namespace,
Permission.Action... actions)
A utility used to revoke a user's namespace permissions.
|
static void |
revoke(com.google.protobuf.RpcController controller,
AccessControlProtos.AccessControlService.BlockingInterface protocol,
String userShortName,
TableName tableName,
byte[] f,
byte[] q,
Permission.Action... actions)
A utility used to revoke a user's table permissions.
|
static Permission |
toPermission(AccessControlProtos.Permission proto)
Converts a Permission proto to a client Permission object.
|
static AccessControlProtos.Permission |
toPermission(Permission perm)
Convert a client Permission to a Permission proto
|
static Permission.Action |
toPermissionAction(AccessControlProtos.Permission.Action action)
Converts a Permission.Action proto to a client Permission.Action object.
|
static AccessControlProtos.Permission.Action |
toPermissionAction(Permission.Action action)
Convert a client Permission.Action to a Permission.Action proto
|
static List<Permission.Action> |
toPermissionActions(List<AccessControlProtos.Permission.Action> protoActions)
Converts a list of Permission.Action proto to a list of client Permission.Action objects.
|
static TablePermission |
toTablePermission(AccessControlProtos.Permission proto)
Converts a Permission proto to a client TablePermission object.
|
static UserPermission |
toUserPermission(AccessControlProtos.UserPermission proto)
Converts a user permission proto to a client user permission object.
|
static 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(AccessControlProtos.UsersAndPermissions proto) |
static AccessControlProtos.UsersAndPermissions |
toUsersAndPermissions(org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap<String,Permission> perms) |
static AccessControlProtos.UsersAndPermissions |
toUsersAndPermissions(String user,
Permission perms) |
static org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap<String,TablePermission> |
toUserTablePermissions(AccessControlProtos.UsersAndPermissions proto)
Convert a protobuf UserTablePermissions to a
ListMultimap<String, TablePermission> where key is username.
|
static AccessControlProtos.UsersAndPermissions |
toUserTablePermissions(org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap<String,TablePermission> perm)
Convert a ListMultimap<String, TablePermission> where key is username
to a protobuf UserPermission
|
public static AccessControlProtos.GrantRequest buildGrantRequest(String username, TableName tableName, byte[] family, byte[] qualifier, boolean mergeExistingPermissions, 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 AccessControlProtos.GrantRequest buildGrantRequest(String username, String namespace, boolean mergeExistingPermissions, 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 AccessControlProtos.RevokeRequest buildRevokeRequest(String username, AccessControlProtos.Permission.Action... actions)
username
- the short user name whose permissions to be revokedactions
- the permissions to be revokedAccessControlProtos
RevokeRequestpublic static AccessControlProtos.RevokeRequest buildRevokeRequest(String username, String namespace, 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 AccessControlProtos.GrantRequest buildGrantRequest(String username, boolean mergeExistingPermissions, AccessControlProtos.Permission.Action... actions)
username
- the short user name who to grant permissionsactions
- the permissions to be grantedAccessControlProtos
GrantRequestpublic static AccessControlProtos.UsersAndPermissions toUsersAndPermissions(String user, Permission perms)
public static 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(AccessControlProtos.UsersAndPermissions proto)
public static Permission toPermission(AccessControlProtos.Permission proto)
proto
- the protobuf Permissionpublic static TablePermission toTablePermission(AccessControlProtos.Permission proto)
proto
- the protobuf Permissionpublic static AccessControlProtos.Permission toPermission(Permission perm)
perm
- the client Permissionpublic static List<Permission.Action> toPermissionActions(List<AccessControlProtos.Permission.Action> protoActions)
protoActions
- the list of protobuf Actionspublic static Permission.Action toPermissionAction(AccessControlProtos.Permission.Action action)
action
- the protobuf Actionpublic static AccessControlProtos.Permission.Action toPermissionAction(Permission.Action action)
action
- the client Actionpublic static AccessControlProtos.UserPermission toUserPermission(UserPermission perm)
perm
- the client UserPermissionpublic static AccessControlProtos.GetUserPermissionsResponse buildGetUserPermissionsResponse(List<UserPermission> permissions)
public static UserPermission toUserPermission(AccessControlProtos.UserPermission proto)
proto
- the protobuf UserPermissionpublic static AccessControlProtos.UsersAndPermissions toUserTablePermissions(org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap<String,TablePermission> perm)
perm
- the list of user and table permissionspublic static void grant(com.google.protobuf.RpcController controller, 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 grantedcom.google.protobuf.ServiceException
public static void grant(com.google.protobuf.RpcController controller, 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 grantedcom.google.protobuf.ServiceException
public static void grant(com.google.protobuf.RpcController controller, 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.
protocol
- the AccessControlService protocol proxynamespace
- the short name of the user to grant permissionsactions
- the permissions to be grantedcom.google.protobuf.ServiceException
public static void revoke(com.google.protobuf.RpcController controller, AccessControlProtos.AccessControlService.BlockingInterface protocol, String userShortName, 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 revoke permissionsactions
- the permissions to be revokedcom.google.protobuf.ServiceException
public static void revoke(com.google.protobuf.RpcController controller, AccessControlProtos.AccessControlService.BlockingInterface protocol, String userShortName, TableName tableName, byte[] f, byte[] q, 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 revoke permissionstableName
- optional table namef
- optional column familyq
- optional qualifieractions
- the permissions to be revokedcom.google.protobuf.ServiceException
public static void revoke(com.google.protobuf.RpcController controller, AccessControlProtos.AccessControlService.BlockingInterface protocol, String userShortName, String namespace, 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 revoke permissionsnamespace
- optional table nameactions
- the permissions to be revokedcom.google.protobuf.ServiceException
public static List<UserPermission> getUserPermissions(com.google.protobuf.RpcController controller, AccessControlProtos.AccessControlService.BlockingInterface protocol) throws com.google.protobuf.ServiceException
It's also called by the shell, in case you want to find references.
protocol
- the AccessControlService protocol proxycom.google.protobuf.ServiceException
public static List<UserPermission> getUserPermissions(com.google.protobuf.RpcController controller, 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.
protocol
- the AccessControlService protocol proxyt
- optional table namecom.google.protobuf.ServiceException
public static List<UserPermission> getUserPermissions(com.google.protobuf.RpcController controller, 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.
protocol
- the AccessControlService protocol proxynamespace
- name of the namespacecom.google.protobuf.ServiceException
public static org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap<String,TablePermission> toUserTablePermissions(AccessControlProtos.UsersAndPermissions proto)
proto
- the protobuf UserPermissionpublic static AccessControlProtos.RevokeRequest buildRevokeRequest(String username, TableName tableName, byte[] family, byte[] qualifier, 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–2019 Cloudera. All rights reserved.