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 de26f39b0f6..5a948055fb2 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())); + } }