code: public void grant(final String iResource, final int iOperation) {
      final Byte current = rules.get(iResource);
      byte currentValue = current == null ? PERMISSION_NONE : current.byteValue();
  
      currentValue |= (byte) iOperation;
  
      rules.put(iResource, currentValue);
      document.field("rules", rules);
    }
docs: Grant a permission to the resource.
  
  @param iResource
  Requested resource
  @param iOperation
  Permission to grant/add