docs: public void lockResource(CmsRequestContext context, CmsResource resource, CmsLockType type) throws CmsException {
  
          CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
          try {
              checkOfflineProject(dbc);
              checkPermissions(dbc, resource, CmsPermissionSet.ACCESS_WRITE, false, CmsResourceFilter.ALL);
              m_driverManager.lockResource(dbc, resource, type);
          } catch (Exception e) {
              CmsMessageContainer messageContainer;
              if (e instanceof CmsLockException) {
                  messageContainer = ((CmsLockException)e).getMessageContainer();
              } else {
                  messageContainer = Messages.get().container(
                      Messages.ERR_LOCK_RESOURCE_2,
                      context.getSitePath(resource),
                      type.toString());
              }
              dbc.report(null, messageContainer, e);
          } finally {
              dbc.clear();
          }
      }