HBASE-20635 Add missing shaded-pb conversion method for UserPermission

Signed-off-by: Josh Elser <els...@apache.org>
Signed-off-by: Ted Yu <yuzhih...@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/40f0a434
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/40f0a434
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/40f0a434

Branch: refs/heads/HBASE-20331
Commit: 40f0a434626215634ad5922f028b4c54a2e4c895
Parents: b25c782
Author: Rajeshbabu Chintaguntla <rajeshb...@apache.org>
Authored: Mon Jun 11 14:58:18 2018 -0400
Committer: Josh Elser <els...@apache.org>
Committed: Mon Jun 11 14:58:18 2018 -0400

----------------------------------------------------------------------
 .../hbase/security/access/ShadedAccessControlUtil.java   | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/40f0a434/hbase-client/src/main/java/org/apache/hadoop/hbase/security/access/ShadedAccessControlUtil.java
----------------------------------------------------------------------
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/security/access/ShadedAccessControlUtil.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/access/ShadedAccessControlUtil.java
index de26f39..5a94805 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/security/access/ShadedAccessControlUtil.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/access/ShadedAccessControlUtil.java
@@ -274,4 +274,15 @@ public class ShadedAccessControlUtil {
     }
     return builder.build();
   }
+
+  /**
+   * Converts a user permission proto to a client user permission object.
+   *
+   * @param proto the protobuf UserPermission
+   * @return the converted UserPermission
+   */
+  public static UserPermission 
toUserPermission(org.apache.hadoop.hbase.shaded.protobuf.generated.AccessControlProtos.UserPermission
 proto) {
+    return new UserPermission(proto.getUser().toByteArray(),
+        toTablePermission(proto.getPermission()));
+  }
 }

Reply via email to