CmsPublishJobInfoBean publishJob = m_currentPublishThread.getPublishJob(); try { abortPublishJob(m_adminUserId, new CmsPublishJobEnqueued(publishJob), false); } catch (CmsException e) { if (LOG.isErrorEnabled()) {
CmsPublishJobInfoBean publishJob = m_currentPublishThread.getPublishJob(); try { abortPublishJob(m_adminUserId, new CmsPublishJobEnqueued(publishJob), false); } catch (CmsException e) { if (LOG.isErrorEnabled()) {
/** * Aborts the given publish job.<p> * * @param cms the cms context * @param publishJob the publish job to abort * @param removeJob indicates if the job will be removed or added to history * * @throws CmsException if there is some problem during unlocking the resources * @throws CmsSecurityException if the current user has not enough permissions * @throws CmsPublishException if the publish job can not been aborted */ public void abortPublishJob(CmsObject cms, CmsPublishJobEnqueued publishJob, boolean removeJob) throws CmsException, CmsSecurityException, CmsPublishException { if (!OpenCms.getRoleManager().hasRole(cms, CmsRole.PROJECT_MANAGER) && !cms.getRequestContext().currentUser().getId().equals(publishJob.getUserId())) { // Can only be executed by somebody with the role CmsRole#PROJECT_MANAGER or the owner of the job throw new CmsSecurityException(Messages.get().container( Messages.ERR_PUBLISH_ENGINE_ABORT_DENIED_1, cms.getRequestContext().currentUser().getName())); } m_publishEngine.abortPublishJob(cms.getRequestContext().currentUser().getId(), publishJob, removeJob); }
/** * Aborts the given publish job.<p> * * @param cms the cms context * @param publishJob the publish job to abort * @param removeJob indicates if the job will be removed or added to history * * @throws CmsException if there is some problem during unlocking the resources * @throws CmsSecurityException if the current user has not enough permissions * @throws CmsPublishException if the publish job can not been aborted */ public void abortPublishJob(CmsObject cms, CmsPublishJobEnqueued publishJob, boolean removeJob) throws CmsException, CmsSecurityException, CmsPublishException { if (!OpenCms.getRoleManager().hasRole(cms, CmsRole.PROJECT_MANAGER) && !cms.getRequestContext().getCurrentUser().getId().equals(publishJob.getUserId())) { // Can only be executed by somebody with the role CmsRole#PROJECT_MANAGER or the owner of the job throw new CmsSecurityException( Messages.get().container( Messages.ERR_PUBLISH_ENGINE_ABORT_DENIED_1, cms.getRequestContext().getCurrentUser().getName())); } m_publishEngine.abortPublishJob(cms.getRequestContext().getCurrentUser().getId(), publishJob, removeJob); }