summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVikas Mishra2012-03-05 01:13:14 (EST)
committer Manik Kishore2012-06-19 07:18:57 (EDT)
commitaae5e6e81b8bc8be41e526decb7bca02e7ae3022 (patch)
tree4f85fca4ba8d56c186ec70578b41a385694d6b2d
parente576b611b610c1db8ca34bbe7d54958a1b0acc44 (diff)
downloadorg.eclipse.stardust.ui.web-aae5e6e81b8bc8be41e526decb7bca02e7ae3022.zip
org.eclipse.stardust.ui.web-aae5e6e81b8bc8be41e526decb7bca02e7ae3022.tar.gz
org.eclipse.stardust.ui.web-aae5e6e81b8bc8be41e526decb7bca02e7ae3022.tar.bz2
Jira-ID: CRNT-24026
Removed workaround introduced as a result of CRNT-22816 git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@54283 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/AuthorizationUtils.java46
1 files changed, 1 insertions, 45 deletions
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 306d382..6d6b058 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
@@ -14,16 +14,13 @@ import java.util.Set;
import org.eclipse.stardust.engine.api.model.ModelParticipantInfo;
-import org.eclipse.stardust.engine.api.model.Participant;
import org.eclipse.stardust.engine.api.model.QualifiedModelParticipantInfo;
import org.eclipse.stardust.engine.api.runtime.ActivityInstance;
import org.eclipse.stardust.engine.api.runtime.AdministrationService;
import org.eclipse.stardust.engine.api.runtime.PermissionState;
import org.eclipse.stardust.engine.api.runtime.ProcessInstance;
-import org.eclipse.stardust.engine.api.runtime.User;
import org.eclipse.stardust.engine.core.runtime.utils.ExecutionPermission;
import org.eclipse.stardust.engine.core.runtime.utils.Permissions;
-import org.eclipse.stardust.ui.web.viewscommon.beans.SessionContext;
import org.eclipse.stardust.ui.web.viewscommon.common.spi.user.impl.IppUser;
import org.eclipse.stardust.ui.web.viewscommon.common.spi.user.impl.IppUserProvider;
@@ -59,48 +56,7 @@ public class AuthorizationUtils
*/
public static boolean hasManageCasePermission(ProcessInstance processInstance)
{
- boolean hasPermission = PermissionState.Granted.equals(processInstance.getPermission(PERMISSION_MANAGE_CASE));
- // whole if block is not required and this should be removed
- // first line is sufficient to know permission for "Manage case"
- if (!hasPermission)
- {
- Participant participant = ProcessInstanceUtils.getCaseOwner(processInstance);
- if (null == participant)
- {
- return false;
- }
- else
- {
-
- IppUser currentUser = (IppUser) IppUserProvider.getInstance().getUser();
- if (participant instanceof QualifiedModelParticipantInfo)
- {
- QualifiedModelParticipantInfo qualifiedParticipantInfo = (QualifiedModelParticipantInfo) participant;
- if (currentUser.isInRole(qualifiedParticipantInfo.getQualifiedId()))
- {
- hasPermission = true;
- }
- }
- else if (participant instanceof User)
- {
- User user = SessionContext.findSessionContext().getUser();
- User participantUser = (User) participant;
- if (user.getOID() == participantUser.getOID())
- {
- hasPermission = true;
- }
- }
- else
- {
- if (currentUser.isInRole(participant.getId()))
- {
- hasPermission = true;
- }
- }
- }
-
- }
- return hasPermission;
+ return PermissionState.Granted.equals(processInstance.getPermission(PERMISSION_MANAGE_CASE));
}