docs: private CmsLock unlockResource(String resourceName, boolean systemLocks) {
  
          m_isDirty = true;
  
          // get the current lock
          CmsLock lock = OpenCms.getMemoryMonitor().getCachedLock(resourceName);
          if (lock == null) {
              return CmsLock.getNullLock();
          }
  
          // check the lock type (system or user) to remove
          if (systemLocks) {
              if (!lock.getSystemLock().isUnlocked()) {
                  // if a system lock has to be removed
                  // user locks are removed too
                  OpenCms.getMemoryMonitor().uncacheLock(resourceName);
                  return lock;
              } else {
                  // if it is a edition lock, do nothing
                  return CmsLock.getNullLock();
              }
          } else {
              if (lock.getSystemLock().isUnlocked()) {
                  // if it is just an edition lock just remove it
                  OpenCms.getMemoryMonitor().uncacheLock(resourceName);
                  return lock;
              } else {
                  // if it is a system lock check the edition lock
                  if (!lock.getEditionLock().isUnlocked()) {
                      // remove the edition lock
                      CmsLock tmp = lock.getEditionLock();
                      CmsLock sysLock = lock.getSystemLock();
                      sysLock.setRelatedLock(null);
                      if (!sysLock.equals(lock)) {
                          // replace the lock entry if needed
                          OpenCms.getMemoryMonitor().cacheLock(sysLock);
                      }
                      return tmp;
                  } else {
                      // if there is no edition lock, only a system lock, do nothing
                      return CmsLock.getNullLock();
                  }
              }
          }
      }