public static AccessControlProtos.UserPermission toUserPermission(UserPermission perm) {
    return AccessControlProtos.UserPermission.newBuilder()
      .setUser(ByteString.copyFromUtf8(perm.getUser()))
      .setPermission(toPermission(perm.getPermission())).build();
  }
Convert a client user permission to a user permission proto
@param perm the client UserPermission
@return the protobuf UserPermission
hbase-client/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlUtil.java