public boolean isCanDeleteStep(StepDescriptor stepDescriptor) throws WorkflowException { if (!workflow.isEditable()) { // Can only delete step if the worklfow can be edited // No need to do the checks below in this case, so just return return false; } // Determine if the step is a destination step of any existing transitions return workflow.getActionsWithResult(stepDescriptor).isEmpty() && !isOldStepOnDraft(stepDescriptor); }
public String getLinksHtml() { String viewMode = workflow.isEditable() || !isDiagramMode() ? "text" : "diagram"; return workflowHeaderWebComponent.getLinksHtml(getWorkflow(), getProject(), viewMode, getWorkflow().isEditable()); }
public String doDefault() throws Exception { if (workflow.isEditable()) { newWorkflowName = workflow.getName(); description = workflow.getDescription(); return INPUT; } else { addErrorMessage(getText("admin.errors.workflow.cannot.be.edited.as.it.is.not.editable")); } return ERROR; }
protected void doValidation() { if (isOldStepOnDraft(step)) { addErrorMessage(getText("admin.errors.delete.step.draft")); } if(!workflow.isEditable()) { addErrorMessage(getText("admin.errors.delete.step.not.editable")); } }
public void updateWorkflow(final JiraServiceContext jiraServiceContext, final JiraWorkflow workflow) { if (!hasAdminPermission(jiraServiceContext)) { addError(jiraServiceContext, "admin.workflows.service.error.no.admin.permission", Reason.FORBIDDEN); return; } if ((workflow == null) || (workflow.getDescriptor() == null)) { addError(jiraServiceContext, "admin.workflows.service.error.update.no.workflow", Reason.VALIDATION_FAILED); return; } if (!workflow.isEditable()) { addError(jiraServiceContext, "admin.workflows.service.error.not.editable", Reason.VALIDATION_FAILED); return; } // This lock ensures that the overwriteWorkflow action above allows for an atomic validation and overwrite // of the workflow. overwriteWorkflowLock.lock(); try { workflowManager.updateWorkflow(jiraServiceContext.getLoggedInApplicationUser(), workflow); } finally { overwriteWorkflowLock.unlock(); } }
if (!workflow.isEditable())
if (!currentWorkflow.isEditable())