summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVikas Mishra2012-03-19 06:12:07 (EDT)
committerManik Kishore2012-06-19 07:22:03 (EDT)
commit083274d7ba229dd1e503bb242de83566c29d361c (patch)
treef2741d833de47d5ee8950ae734e032567eda2ae7
parent302c94bf42aa85bc265a3aed3221721226b6eb78 (diff)
downloadorg.eclipse.stardust.ui.web-083274d7ba229dd1e503bb242de83566c29d361c.zip
org.eclipse.stardust.ui.web-083274d7ba229dd1e503bb242de83566c29d361c.tar.gz
org.eclipse.stardust.ui.web-083274d7ba229dd1e503bb242de83566c29d361c.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@54636 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/dialogs/JoinProcessDialogBean.java2
-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/utils/ProcessInstanceUtils.java16
3 files changed, 27 insertions, 8 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 f97c15a..73dd462 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
@@ -165,7 +165,7 @@ public class JoinProcessDialogBean extends PopupUIComponentBean implements ICall
COMMON_MESSAGE_BEAN.getString("common.authorization.msg"));
return true;
}
- else if (!ProcessInstanceUtils.isAbortable(sourceProcessInstance))
+ else if (!ProcessInstanceUtils.isAbortableState(sourceProcessInstance))
{
MessageDialog.addMessage(MessageType.ERROR, messageBean.getString("common.error"),
COMMON_MESSAGE_BEAN.getString("common.notifyProcessAlreadyAborted"));
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 7397c0d..629b630 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,11 +59,22 @@ public class AuthorizationUtils
return PermissionState.Granted.equals(processInstance.getPermission(PERMISSION_MANAGE_CASE));
}
-
+ /**
+ *
+ * @param processInstance
+ * @return
+ */
public static boolean hasAbortPermission(ProcessInstance processInstance)
{
- return PermissionState.Granted.equals(processInstance
- .getPermission(Permissions.PROCESS_DEFINITION_ABORT_PROCESS_INSTANCES));
+ if (processInstance.isCaseProcessInstance())
+ {
+ return hasManageCasePermission(processInstance);
+ }
+ else
+ {
+ 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/utils/ProcessInstanceUtils.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ProcessInstanceUtils.java
index 9f191f9..91eadf1 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ProcessInstanceUtils.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ProcessInstanceUtils.java
@@ -183,10 +183,18 @@ public class ProcessInstanceUtils
*/
public static boolean isAbortable(ProcessInstance processInstance)
{
- boolean abortable = processInstance == null ? false : !ProcessInstanceState.Aborted
- .equals(processInstance.getState())
- && !ProcessInstanceState.Completed.equals(processInstance.getState())
- && AuthorizationUtils.hasAbortPermission(processInstance);
+ boolean abortable = isAbortableState(processInstance) && AuthorizationUtils.hasAbortPermission(processInstance);
+ return abortable;
+ }
+
+ /**
+ * @param processInstance
+ * @return
+ */
+ public static boolean isAbortableState(ProcessInstance processInstance)
+ {
+ boolean abortable = processInstance == null ? false : !ProcessInstanceState.Aborted.equals(processInstance
+ .getState()) && !ProcessInstanceState.Completed.equals(processInstance.getState());
return abortable;
}