code: public void chflags(CmsDbContext dbc, CmsResource resource, int flags) throws CmsException {
  
          // must operate on a clone to ensure resource is not modified in case permissions are not granted
          CmsResource clone = (CmsResource)resource.clone();
          clone.setFlags(flags);
          // log it
          log(
              dbc,
              new CmsLogEntry(
                  dbc,
                  resource.getStructureId(),
                  CmsLogEntryType.RESOURCE_FLAGS,
                  new String[] {resource.getRootPath()}),
              false);
          // write it
          writeResource(dbc, clone);
      }
docs: Changes the resource flags of a resource.<p>
  
  The resource flags are used to indicate various "special" conditions
  for a resource. Most notably, the "internal only" setting which signals
  that a resource can not be directly requested with it's URL.<p>
  
  @param dbc the current database context
  @param resource the resource to change the flags for
  @param flags the new resource flags for this resource
  
  @throws CmsException if something goes wrong
  
  @see CmsObject#chflags(String, int)
  @see I_CmsResourceType#chflags(CmsObject, CmsSecurityManager, CmsResource, int)