From 5a165f927163b4a48c6c18a8c8202bae5efc17bd Mon Sep 17 00:00:00 2001 From: "Katarina Valalikova (katkav)" Date: Thu, 17 Jul 2014 11:53:14 +0200 Subject: [PATCH] fixing GUI authorzation --- .../web/component/util/ObjectWrapperUtil.java | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/ObjectWrapperUtil.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/ObjectWrapperUtil.java index 3429f73e87c..cd531b0c1f8 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/ObjectWrapperUtil.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/ObjectWrapperUtil.java @@ -26,9 +26,7 @@ public static ObjectWrapper createObjectWrapper(String di public static ObjectWrapper createObjectWrapper(String displayName, String description, PrismObject object, ContainerStatus status, boolean delayContainerCreation, PageBase pageBase) { try { - AuthorizationPhaseType phase = getAuthorizationPhase(status); - - PrismContainerDefinition objectDefinitionForEditing = pageBase.getModelInteractionService().getEditObjectDefinition(object, phase); + PrismContainerDefinition objectDefinitionForEditing = pageBase.getModelInteractionService().getEditObjectDefinition(object, AuthorizationPhaseType.REQUEST); RefinedObjectClassDefinition objectClassDefinitionForEditing = null; if (isShadow(object)) { PrismReference resourceRef = object.findReference(ShadowType.F_RESOURCE_REF); @@ -43,21 +41,7 @@ public static ObjectWrapper createObjectWrapper(String di } } - private static AuthorizationPhaseType getAuthorizationPhase(ContainerStatus status) { - if (status == null){ - return null; - } - switch (status) { - case ADDING: - return AuthorizationPhaseType.REQUEST; - case MODIFYING: - return AuthorizationPhaseType.EXECUTION; - - default: - return null; - } - } - + private static boolean isShadow(PrismObject object){ return (object.getCompileTimeClass() != null && ShadowType.class.isAssignableFrom(object .getCompileTimeClass()))