public static AccessControlProtos.UsersAndPermissions
    toUsersAndPermissions(ListMultimap<String, Permission> perms) {
    AccessControlProtos.UsersAndPermissions.Builder builder =
      AccessControlProtos.UsersAndPermissions.newBuilder();
    for (Map.Entry<String, Collection<Permission>> entry : perms.asMap().entrySet()) {
      AccessControlProtos.UsersAndPermissions.UserPermissions.Builder userPermBuilder =
        AccessControlProtos.UsersAndPermissions.UserPermissions.newBuilder();
      userPermBuilder.setUser(ByteString.copyFromUtf8(entry.getKey()));
      for (Permission perm : entry.getValue()) {
        userPermBuilder.addPermissions(toPermission(perm));
      }
      builder.addUserPermissions(userPermBuilder.build());
    }
    return builder.build();
  }
Create a request to grant user global permissions.
@param username the short user name who to grant permissions
@param actions  the permissions to be granted
@return A {@link AccessControlProtos} GrantRequest
hbase-client/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlUtil.java