code: public void grant(OrderedHashSet granteeList, SchemaObject dbObject,
                        Right right, Grantee grantor, boolean withGrantOption) {
  
          if (!grantor.isGrantable(dbObject, right)) {
              throw Error.error(ErrorCode.X_0L000, grantor.getNameString());
          }
  
          if (grantor.isAdmin()) {
              grantor = dbObject.getOwner();
          }
  
          checkGranteeList(granteeList);
  
          for (int i = 0; i < granteeList.size(); i++) {
              String  name    = (String) granteeList.get(i);
              Grantee grantee = get(name);
  
              grantee.grant(dbObject, right, grantor, withGrantOption);
  
              if (grantee.isRole) {
                  updateAllRights(grantee);
              }
          }
      }
docs: Grants the rights represented by the rights argument on
  the database object identified by the dbobject argument
  to the Grantee object identified by name argument.<p>
  
  Note: For the dbobject argument, Java Class objects are identified
  using a String object whose value is the fully qualified name
  of the Class, while Table and other objects are
  identified by an HsqlName object.  A Table
  object identifier must be precisely the one obtained by calling
  table.getName(); if a different HsqlName
  object with an identical name attribute is specified, then
  rights checks and tests will fail, since the HsqlName
  class implements its {@link HsqlName#hashCode hashCode} and
  {@link HsqlName#equals equals} methods based on pure object
  identity, rather than on attribute values. <p>