public static HasUserPermissionsRequest buildHasUserPermissionsRequest(String userName,
    List<Permission> permissions) {
    HasUserPermissionsRequest.Builder builder = HasUserPermissionsRequest.newBuilder();
    if (userName != null && !userName.isEmpty()) {
      builder.setUserName(ByteString.copyFromUtf8(userName));
    }
    for (Permission permission : permissions) {
      builder.addPermission(toPermission(permission));
    }
    return builder.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/ShadedAccessControlUtil.java