[ 
https://issues.apache.org/jira/browse/HBASE-20635?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16504542#comment-16504542
 ] 

Rajeshbabu Chintaguntla commented on HBASE-20635:
-------------------------------------------------

[~elserj] 
bq.Rajeshbabu Chintaguntla do you just need to use 
org.apache.hadoop.hbase.security.access.ShadedAccessControlUtil instead? 
Yes it's really helpful. Uploaded simplified patch adding adding the 
toUserPermission in ShadedAccessControlUtil. Thanks for the information.

bq. Should this be added to ShadedAccessControlUtil? (not sure what exactly you 
need for Phoenix)
In Phoenix one of the place if we use custom access controller then trying to 
get the user permissions from AccessControlService.Interface using below method.
{noformat}
      /**
       * <code>rpc GetUserPermissions(.hbase.pb.GetUserPermissionsRequest) 
returns (.hbase.pb.GetUserPermissionsResponse);</code>
       */
      public abstract void getUserPermissions(
          org.apache.hbase.thirdparty.com.google.protobuf.RpcController 
controller,
          
org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.GetUserPermissionsRequest
 request,
          
org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.GetUserPermissionsResponse>
 done);
{noformat}
Here the GetUserPermissionsResponse is shaded and the user permissions list 
returned by it also shaded ones. But there is no particular API to convert the 
shaded user permission to proto to UserPermission object. So this patch is 
required to do the same.
Thanks.

> Support to convert the shaded user permission proto to client user permission 
> object
> ------------------------------------------------------------------------------------
>
>                 Key: HBASE-20635
>                 URL: https://issues.apache.org/jira/browse/HBASE-20635
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Rajeshbabu Chintaguntla
>            Assignee: Rajeshbabu Chintaguntla
>            Priority: Major
>         Attachments: HBASE-20635.patch, HBASE-20635_v2.patch, 
> PHOENIX-4528_5.x-HBase-2.0_v2.patch
>
>
> Currently we have API to build the protobuf UserPermission to client user 
> permission in AccessControlUtil but we cannot do the same when we use shaded 
> protobufs.
> {noformat}
>   /**
>    * Converts a user permission proto to a client user permission object.
>    *
>    * @param proto the protobuf UserPermission
>    * @return the converted UserPermission
>    */
>   public static UserPermission 
> toUserPermission(AccessControlProtos.UserPermission proto) {
>     return new UserPermission(proto.getUser().toByteArray(),
>         toTablePermission(proto.getPermission()));
>   }
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to