code: public List<CmsAccessControlEntry> getAccessControlEntries(
          CmsDbContext dbc,
          CmsResource resource,
          boolean getInherited)
      throws CmsException {
  
          // get the ACE of the resource itself
          I_CmsUserDriver userDriver = getUserDriver(dbc);
          I_CmsVfsDriver vfsDriver = getVfsDriver(dbc);
          List<CmsAccessControlEntry> ace = userDriver.readAccessControlEntries(
              dbc,
              dbc.currentProject(),
              resource.getResourceId(),
              false);
  
          // sort and check if we got the 'overwrite all' ace to stop looking up
          boolean overwriteAll = sortAceList(ace);
  
          // get the ACE of each parent folder
          // Note: for the immediate parent, get non-inherited access control entries too,
          // if the resource is not a folder
          String parentPath = CmsResource.getParentFolder(resource.getRootPath());
          int d = (resource.isFolder()) ? 1 : 0;
  
          while (!overwriteAll && getInherited && (parentPath != null)) {
              resource = vfsDriver.readFolder(dbc, dbc.currentProject().getUuid(), parentPath);
              List<CmsAccessControlEntry> entries = userDriver.readAccessControlEntries(
                  dbc,
                  dbc.currentProject(),
                  resource.getResourceId(),
                  d > 0);
  
              // sort and check if we got the 'overwrite all' ace to stop looking up
              overwriteAll = sortAceList(entries);
  
              for (CmsAccessControlEntry e : entries) {
                  e.setFlags(CmsAccessControlEntry.ACCESS_FLAGS_INHERITED);
              }
  
              ace.addAll(entries);
              parentPath = CmsResource.getParentFolder(resource.getRootPath());
              d++;
          }
  
          return ace;
      }
docs: Returns the list of access control entries of a resource given its name.<p>
  
  @param dbc the current database context
  @param resource the resource to read the access control entries for
  @param getInherited true if the result should include all access control entries inherited by parent folders
  
  @return a list of <code>{@link CmsAccessControlEntry}</code> objects defining all permissions for the given resource
  
  @throws CmsException if something goes wrong