code: private void lockResource(CmsObject cms, CmsLock lock, CmsResource res) throws CmsException {
  
          if (lock.isNullLock()) {
              cms.lockResource(res.getRootPath());
          }
      }
docs: Locks the given resource (if required).<p>
  
  @param cms the OpenCms user context
  @param lock the previous lock status of the resource
  @param res the resource to lock
  
  @throws CmsException in case something goes wrong