Skip to content

Commit

Permalink
Fix "Show all assignments" (MID-4691)
Browse files Browse the repository at this point in the history
The appliesToFocusWithAnyRelation() method on assignment targets
was too strict; it expected that the target is directly assigned
(order=1). Now it also accepts any targets with matching order.
However, the whole concept of matching order has to be rethought.

(cherry picked from commit e309900)
  • Loading branch information
mederly committed Jul 6, 2018
1 parent 286b0dc commit 5ff4c62
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Expand Up @@ -451,6 +451,7 @@ static boolean computeMatchingOrder(EvaluationOrder evaluationOrder, Integer ass
extraRelations.removeIf(r -> QNameUtil.match(r, orderConstraint.getRelation()));
}
}
// TODO this is to be reconsidered -- why do we consider assignment of relation e.g. approver non-matching?
if (!extraRelations.isEmpty()) {
rv = false;
}
Expand Down
Expand Up @@ -67,8 +67,16 @@ public boolean appliesToFocus() {

@Override
public boolean appliesToFocusWithAnyRelation() {
// TODO clean up this method
if (appliesToFocus()) {
// This covers any indirectly assigned targets, like user -> org -> parent-org -> root-org -(I)-> role
// And directly assigned membership relations as well.
return true;
}
// And this covers any directly assigned non-membership relations (like approver or owner).
// Actually I think these should be also covered by appliesToFocus() i.e. their isMatchingOrder should be true.
// But for some reason it is currently not so.
EvaluationOrder order = assignmentPath.last().getEvaluationOrder();
// TODO check if transitive evaluations are taken into account (they are probably accounted for during assignment evaluation)
return order.getSummaryOrder() == 1 || order.getSummaryOrder() == 0 && order.getMatchingRelationOrder(SchemaConstants.ORG_DEPUTY) > 0;
}

Expand Down

0 comments on commit 5ff4c62

Please sign in to comment.