docs: protected void performSingleResourceOperation(String resourceName, int dialogAction) throws CmsException {
  
          // store original name to use for lock action
          String originalResourceName = resourceName;
          CmsResource res = getCms().readResource(resourceName, CmsResourceFilter.ALL);
          if (res.isFolder() && !resourceName.endsWith("/")) {
              resourceName += "/";
          }
          org.opencms.lock.CmsLock lock = getCms().getLock(res);
          // perform action depending on dialog uri
          switch (dialogAction) {
              case TYPE_LOCKCHANGE:
              case TYPE_LOCK:
                  if (lock.isNullLock()) {
                      getCms().lockResource(originalResourceName);
                  } else if (!lock.isDirectlyOwnedInProjectBy(getCms())) {
                      getCms().changeLock(resourceName);
                  }
                  break;
              case TYPE_UNLOCK:
              default:
                  if (lock.isNullLock()) {
                      break;
                  }
                  if (lock.isOwnedBy(getCms().getRequestContext().getCurrentUser())) {
                      getCms().unlockResource(resourceName);
                  }
          }
      }