Search in sources :

Example 11 with AuthorizationDecisionType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.AuthorizationDecisionType in project midpoint by Evolveum.

the class ObjectSecurityConstraintsImpl method findItemDecisionPhase.

public AuthorizationDecisionType findItemDecisionPhase(ItemPath nameOnlyItemPath, String actionUrl, AuthorizationPhaseType phase) {
    ItemSecurityConstraintsImpl itemConstraints = getItemConstraints(actionUrl, phase);
    AuthorizationDecisionType decision = null;
    if (itemConstraints != null) {
        decision = itemConstraints.findItemDecision(nameOnlyItemPath);
        if (AuthorizationDecisionType.DENY.equals(decision)) {
            return AuthorizationDecisionType.DENY;
        }
    }
    ItemSecurityConstraintsImpl itemConstraintsActionAll = getItemConstraints(AuthorizationConstants.AUTZ_ALL_URL, phase);
    if (itemConstraintsActionAll == null) {
        return decision;
    }
    AuthorizationDecisionType decisionActionAll = itemConstraintsActionAll.findItemDecision(nameOnlyItemPath);
    if (AuthorizationDecisionType.DENY.equals(decisionActionAll)) {
        return AuthorizationDecisionType.DENY;
    }
    if (AuthorizationDecisionType.ALLOW.equals(decisionActionAll)) {
        return AuthorizationDecisionType.ALLOW;
    }
    return decision;
}
Also used : AuthorizationDecisionType(com.evolveum.midpoint.xml.ns._public.common.common_3.AuthorizationDecisionType)

Aggregations

AuthorizationDecisionType (com.evolveum.midpoint.xml.ns._public.common.common_3.AuthorizationDecisionType)10 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)6 AuthorizationException (com.evolveum.midpoint.util.exception.AuthorizationException)3 SecurityViolationException (com.evolveum.midpoint.util.exception.SecurityViolationException)3 ArrayList (java.util.ArrayList)3 ContainerDelta (com.evolveum.midpoint.prism.delta.ContainerDelta)2 ItemDelta (com.evolveum.midpoint.prism.delta.ItemDelta)2 ObjectDelta (com.evolveum.midpoint.prism.delta.ObjectDelta)2 RepositoryService (com.evolveum.midpoint.repo.api.RepositoryService)2 SchemaConstants (com.evolveum.midpoint.schema.constants.SchemaConstants)2 InternalsConfig (com.evolveum.midpoint.schema.internals.InternalsConfig)2 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)2 Task (com.evolveum.midpoint.task.api.Task)2 DebugUtil (com.evolveum.midpoint.util.DebugUtil)2 QNameUtil (com.evolveum.midpoint.util.QNameUtil)2 CommunicationException (com.evolveum.midpoint.util.exception.CommunicationException)2 ConfigurationException (com.evolveum.midpoint.util.exception.ConfigurationException)2 ExpressionEvaluationException (com.evolveum.midpoint.util.exception.ExpressionEvaluationException)2 ObjectNotFoundException (com.evolveum.midpoint.util.exception.ObjectNotFoundException)2 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)2