code: public void writeAccessControlEntry(CmsDbContext dbc, CmsResource resource, CmsAccessControlEntry ace)
      throws CmsException {
  
          // write the new ace
          getUserDriver(dbc).writeAccessControlEntry(dbc, dbc.currentProject(), ace);
  
          // log it
          log(
              dbc,
              new CmsLogEntry(
                  dbc,
                  resource.getStructureId(),
                  CmsLogEntryType.RESOURCE_PERMISSIONS,
                  new String[] {resource.getRootPath()}),
              false);
  
          // update the "last modified" information
          setDateLastModified(dbc, resource, resource.getDateLastModified());
  
          // clear the cache
          m_monitor.clearAccessControlListCache();
  
          // fire a resource modification event
          Map<String, Object> data = new HashMap<String, Object>(2);
          data.put(I_CmsEventListener.KEY_RESOURCE, resource);
          data.put(I_CmsEventListener.KEY_CHANGE, new Integer(CHANGED_ACCESSCONTROL));
          OpenCms.fireCmsEvent(new CmsEvent(I_CmsEventListener.EVENT_RESOURCE_MODIFIED, data));
      }
docs: Writes an access control entries to a given resource.<p>
  
  @param dbc the current database context
  @param resource the resource
  @param ace the entry to write
  
  @throws CmsException if something goes wrong