public static ListMultimap<String, Permission>
    toUsersAndPermissions(AccessControlProtos.UsersAndPermissions proto) {
    ListMultimap<String, Permission> result = ArrayListMultimap.create();
    for (AccessControlProtos.UsersAndPermissions.UserPermissions userPerms : proto
      .getUserPermissionsList()) {
      String user = userPerms.getUser().toStringUtf8();
      for (AccessControlProtos.Permission perm : userPerms.getPermissionsList()) {
        result.put(user, toPermission(perm));
      }
    }
    return result;
  }
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