summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVikas Mishra2012-03-19 06:39:46 (EDT)
committerManik Kishore2012-06-19 07:22:05 (EDT)
commit0e0e6c3f3e86632eb544427c758f7a25c3aecf41 (patch)
treea5cf538531a799b29b2888a0211d745b690d2695
parent083274d7ba229dd1e503bb242de83566c29d361c (diff)
downloadorg.eclipse.stardust.ui.web-0e0e6c3f3e86632eb544427c758f7a25c3aecf41.zip
org.eclipse.stardust.ui.web-0e0e6c3f3e86632eb544427c758f7a25c3aecf41.tar.gz
org.eclipse.stardust.ui.web-0e0e6c3f3e86632eb544427c758f7a25c3aecf41.tar.bz2
Jira-ID: CRNT-24246
Case Owner and Admin should be allowed to 'Abort and Join' Case git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@54638 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/dialogs/JoinProcessDialogBean.java3
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/AuthorizationUtils.java17
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/casemanagement/CaseDetailsBean.java19
-rw-r--r--views-common/src/main/resources/META-INF/xhtml/views/case/caseDetailsViewToolbar.xhtml17
4 files changed, 17 insertions, 39 deletions
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/dialogs/JoinProcessDialogBean.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/dialogs/JoinProcessDialogBean.java
index 73dd462..4f2843f 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/dialogs/JoinProcessDialogBean.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/dialogs/JoinProcessDialogBean.java
@@ -159,7 +159,8 @@ public class JoinProcessDialogBean extends PopupUIComponentBean implements ICall
private boolean showNotificationForAbortedSource()
{
MessagePropertiesBean messageBean = MessagePropertiesBean.getInstance();
- if (!AuthorizationUtils.hasAbortPermission(sourceProcessInstance))
+ if (sourceProcessInstance.isCaseProcessInstance()
+ && !AuthorizationUtils.hasManageCasePermission(sourceProcessInstance))
{
MessageDialog.addMessage(MessageType.ERROR, messageBean.getString("common.error"),
COMMON_MESSAGE_BEAN.getString("common.authorization.msg"));
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/AuthorizationUtils.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/AuthorizationUtils.java
index 629b630..7397c0d 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/AuthorizationUtils.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/AuthorizationUtils.java
@@ -59,22 +59,11 @@ public class AuthorizationUtils
return PermissionState.Granted.equals(processInstance.getPermission(PERMISSION_MANAGE_CASE));
}
- /**
- *
- * @param processInstance
- * @return
- */
+
public static boolean hasAbortPermission(ProcessInstance processInstance)
{
- if (processInstance.isCaseProcessInstance())
- {
- return hasManageCasePermission(processInstance);
- }
- else
- {
- return PermissionState.Granted.equals(processInstance
- .getPermission(Permissions.PROCESS_DEFINITION_ABORT_PROCESS_INSTANCES));
- }
+ return PermissionState.Granted.equals(processInstance
+ .getPermission(Permissions.PROCESS_DEFINITION_ABORT_PROCESS_INSTANCES));
}
public static boolean hasDelegatePermission(ActivityInstance activityInstance)
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/casemanagement/CaseDetailsBean.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/casemanagement/CaseDetailsBean.java
index 36d04d2..d900577 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/casemanagement/CaseDetailsBean.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/casemanagement/CaseDetailsBean.java
@@ -104,8 +104,7 @@ public class CaseDetailsBean extends PopupUIComponentBean
private ProcessTableHelper processHelper;
private String duration;
- private String activityNotes;
- private boolean abortProcess;
+ private String activityNotes;
private String state;
private boolean supportsProcessAttachments;
@@ -178,7 +177,7 @@ public class CaseDetailsBean extends PopupUIComponentBean
}
setSupportsProcessAttachments(DMSHelper.existsProcessAttachmentsDataPath(processInstance));
- setAbortProcess(ProcessInstanceUtils.isAbortable(processInstance));
+
state = MessagesViewsCommonBean.getInstance().getString(
STATE_PREFIX + processInstance.getState().getName().toLowerCase());
@@ -796,18 +795,8 @@ public class CaseDetailsBean extends PopupUIComponentBean
public void setActivityNotes(String activityNotes)
{
this.activityNotes = activityNotes;
- }
-
- public boolean isAbortProcess()
- {
- return abortProcess;
- }
-
- public void setAbortProcess(boolean abortProcess)
- {
- this.abortProcess = abortProcess;
- }
-
+ }
+
public String getProcessName()
{
return processName;
diff --git a/views-common/src/main/resources/META-INF/xhtml/views/case/caseDetailsViewToolbar.xhtml b/views-common/src/main/resources/META-INF/xhtml/views/case/caseDetailsViewToolbar.xhtml
index 03f8f15..7dbf4a1 100644
--- a/views-common/src/main/resources/META-INF/xhtml/views/case/caseDetailsViewToolbar.xhtml
+++ b/views-common/src/main/resources/META-INF/xhtml/views/case/caseDetailsViewToolbar.xhtml
@@ -12,17 +12,16 @@
<ice:panelGrid cellspacing="0" cellpadding="2"
style="padding-right: 10px;" columns="15">
- <pc:automationTag value="auto-COM-CaseDetView-ToolbarTerminate"/>
- <ice:commandButton
- image="/plugins/views-common/images/icons/abort_process.png"
- action="#{caseDetailsBean.terminateProcess}"
- disabled="#{!caseDetailsBean.abortProcess}" partialSubmit="true"
- title="#{views_common_msgPropsBean['common.tooltip.terminate']}"
- styleClass="toolbar-button" />
+ <pc:automationTag value="auto-COM-CaseDetView-ToolbarTerminate"/>
+
+ <ice:panelGroup>
+ <ice:graphicImage styleClass="iceCmdBtn-dis"
+ value="/plugins/views-common/images/icons/abort_process.png" />
+ </ice:panelGroup>
<!-- Rendered when process termination is allowed -->
<ice:panelGroup
- rendered="#{(caseDetailsBean.abortProcess)}">
+ rendered="#{caseDetailsBean.canManageCase and !caseDetailsBean.inactiveCase}">
<c:set var="bean" value="#{caseDetailsBean}" />
<c:set var="processInstance"
value="#{caseDetailsBean.processInstance}" />
@@ -31,7 +30,7 @@
</ice:panelGroup>
<!-- Rendered when process termination is not allowed -->
<ice:panelGroup
- rendered="#{!(caseDetailsBean.abortProcess)}">
+ rendered="#{!caseDetailsBean.canManageCase or caseDetailsBean.inactiveCase}">
<ice:graphicImage styleClass="iceCmdBtn-dis"
value="/plugins/views-common/images/icons/panelHeader-triggerCollapse.png" />
</ice:panelGroup>