Search in sources :

Example 1 with AssignmentSelectorType

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

the class AbstractModelIntegrationTest method modifyDeputyAssignmentLimits.

protected void modifyDeputyAssignmentLimits(String userDeputyOid, String userTargetOid, boolean add, Task task, OperationResult result, ObjectReferenceType... limitTargets) throws ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException, ObjectAlreadyExistsException, PolicyViolationException, SecurityViolationException {
    modifyUserAssignment(userDeputyOid, userTargetOid, UserType.COMPLEX_TYPE, SchemaConstants.ORG_DEPUTY, task, assignment -> {
        AssignmentSelectorType limitTargetContent = new AssignmentSelectorType();
        assignment.setLimitTargetContent(limitTargetContent);
        for (ObjectReferenceType limitTarget : limitTargets) {
            limitTargetContent.getTargetRef().add(limitTarget);
        }
    }, add, result);
}
Also used : ObjectReferenceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType) AssignmentSelectorType(com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentSelectorType)

Example 2 with AssignmentSelectorType

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

the class AbstractModelIntegrationTest method modifyDeputyAssignmentLimits.

protected void modifyDeputyAssignmentLimits(String userDeputyOid, String userTargetOid, boolean add, Consumer<AssignmentType> assignmentMutator, Task task, OperationResult result, ObjectReferenceType... limitTargets) throws ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException, ObjectAlreadyExistsException, PolicyViolationException, SecurityViolationException {
    modifyUserAssignment(userDeputyOid, userTargetOid, UserType.COMPLEX_TYPE, SchemaConstants.ORG_DEPUTY, task, assignment -> {
        AssignmentSelectorType limitTargetContent = new AssignmentSelectorType();
        assignment.setLimitTargetContent(limitTargetContent);
        for (ObjectReferenceType limitTarget : limitTargets) {
            limitTargetContent.getTargetRef().add(limitTarget);
        }
        if (assignmentMutator != null) {
            assignmentMutator.accept(assignment);
        }
    }, add, result);
}
Also used : ObjectReferenceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType)

Example 3 with AssignmentSelectorType

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

the class Util method isAllowedByLimitations.

static boolean isAllowedByLimitations(AssignmentPathSegment segment, AssignmentType nextAssignment, EvaluationContext<?> ctx) {
    AssignmentType currentAssignment = segment.getAssignment(ctx.evaluateOld);
    AssignmentSelectorType targetLimitation = currentAssignment.getLimitTargetContent();
    if (isDeputyDelegation(nextAssignment, ctx.ae.relationRegistry)) {
        // delegation of delegation
        return targetLimitation != null && BooleanUtils.isTrue(targetLimitation.isAllowTransitive());
    } else {
        // from the delegator to delegatee. To block them we should use order constraints (but also for assignments?).
        return targetLimitation == null || nextAssignment.getTargetRef() == null || FocusTypeUtil.selectorMatches(targetLimitation, nextAssignment, ctx.ae.prismContext);
    }
}
Also used : AssignmentSelectorType(com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentSelectorType) AssignmentType(com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType)

Aggregations

AssignmentSelectorType (com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentSelectorType)2 ObjectReferenceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType)2 AssignmentType (com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType)1