code: public void importAccessControlEntries(
          CmsDbContext dbc,
          CmsResource resource,
          List<CmsAccessControlEntry> acEntries)
      throws CmsException {
  
          I_CmsUserDriver userDriver = getUserDriver(dbc);
          userDriver.removeAccessControlEntries(dbc, dbc.currentProject(), resource.getResourceId());
          List<CmsAccessControlEntry> fixedAces = new ArrayList<>();
          for (CmsAccessControlEntry entry : acEntries) {
              if (entry.getResource() == null) {
                  entry = new CmsAccessControlEntry(
                      resource.getResourceId(),
                      entry.getPrincipal(),
                      entry.getPermissions(),
                      entry.getFlags());
              }
              fixedAces.add(entry);
          }
  
          Iterator<CmsAccessControlEntry> i = fixedAces.iterator();
          while (i.hasNext()) {
              userDriver.writeAccessControlEntry(dbc, dbc.currentProject(), i.next());
          }
          m_monitor.clearAccessControlListCache();
      }
docs: Writes a vector of access control entries as new access control entries of a given resource.<p>
  
  Already existing access control entries of this resource are removed before.
  Access is granted, if:<p>
  <ul>
  <li>the current user has control permission on the resource</li>
  </ul>
  
  @param dbc the current database context
  @param resource the resource
  @param acEntries a list of <code>{@link CmsAccessControlEntry}</code> objects
  
  @throws CmsException if something goes wrong