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

Signed-off-by: Josh Elser <elserj@apache.org>
Signed-off-by: Ted Yu <yuzhihong@gmail.com>
This commit is contained in:
Rajeshbabu Chintaguntla 2018-06-11 14:58:18 -04:00 committed by Josh Elser
parent a8ea49bfb7
commit c0d67209df
1 changed files with 11 additions and 0 deletions

View File

@ -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()));
}
}