docs: public void checkPublishPermissions(CmsDbContext dbc, CmsPublishList publishList)
      throws CmsException, CmsMultiException {
  
          // is the current project an "offline" project?
          checkOfflineProject(dbc);
  
          // check if this is a "direct publish" attempt
          if (!publishList.isDirectPublish()) {
              // check if the user is a manager of the current project, in this case he has publish permissions
              checkManagerOfProjectRole(dbc, dbc.getRequestContext().getCurrentProject());
          } else {
              // direct publish, create exception containers
              CmsMultiException resourceIssues = new CmsMultiException();
              CmsMultiException permissionIssues = new CmsMultiException();
              // iterate all resources in the direct publish list
              Iterator<CmsResource> it = publishList.getDirectPublishResources().iterator();
              List<String> parentFolders = new ArrayList<String>();
              while (it.hasNext()) {
                  CmsResource res = it.next();
                  // the parent folder must not be new or deleted
                  String parentFolder = CmsResource.getParentFolder(res.getRootPath());
                  if ((parentFolder != null) && !parentFolders.contains(parentFolder)) {
                      // check each parent folder only once
                      CmsResource parent = readResource(dbc, parentFolder, CmsResourceFilter.ALL);
                      if (parent.getState().isDeleted()) {
                          if (!(publishList.isUserPublishList() && publishList.getDeletedFolderList().contains(parent))) {
                              // parent folder is deleted - direct publish not allowed
                              resourceIssues.addException(
                                  new CmsVfsException(
                                      Messages.get().container(
                                          Messages.ERR_DIRECT_PUBLISH_PARENT_DELETED_2,
                                          dbc.getRequestContext().removeSiteRoot(res.getRootPath()),
                                          parentFolder)));
                          }
                      }
                      if (parent.getState().isNew()) {
                          if (!(publishList.isUserPublishList() && publishList.getFolderList().contains(parent))) {
                              // parent folder is new - direct publish not allowed
                              resourceIssues.addException(
                                  new CmsVfsException(
                                      Messages.get().container(
                                          Messages.ERR_DIRECT_PUBLISH_PARENT_NEW_2,
                                          dbc.removeSiteRoot(res.getRootPath()),
                                          parentFolder)));
                          }
                      }
                      // add checked parent folder to prevent duplicate checks
                      parentFolders.add(parentFolder);
                  }
                  // check if the user has the explicit permission to direct publish the selected resource
                  if (I_CmsPermissionHandler.PERM_ALLOWED != hasPermissions(
                      dbc.getRequestContext(),
                      res,
                      CmsPermissionSet.ACCESS_DIRECT_PUBLISH,
                      true,
                      CmsResourceFilter.ALL)) {
  
                      // the user has no "direct publish" permissions on the resource
                      permissionIssues.addException(
                          new CmsSecurityException(
                              Messages.get().container(
                                  Messages.ERR_DIRECT_PUBLISH_NO_PERMISSIONS_1,
                                  dbc.removeSiteRoot(res.getRootPath()))));
                  }
              }
              if (resourceIssues.hasExceptions() || permissionIssues.hasExceptions()) {
                  // there are issues, permission check has failed
                  resourceIssues.addExceptions(permissionIssues.getExceptions());
                  throw resourceIssues;
              }
          }
          // no issues have been found , permissions are granted
      }