Skip to content

Commit

Permalink
Rolled back last commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Feb 13, 2017
1 parent 4ea11a6 commit 79d0c4d
Showing 1 changed file with 1 addition and 8 deletions.
Expand Up @@ -285,22 +285,15 @@ public void applySecurityConstraints(List<Item<?,?>> items, ObjectSecurityConstr
// This means allow to all subitems unless otherwise denied.
subDefaultReadDecision = AuthorizationDecisionType.ALLOW;
}
boolean itemWasEmpty = item.isEmpty(); // to prevent removal of originally empty items
List<? extends PrismContainerValue<?>> values = ((PrismContainer<?>)item).getValues();
Iterator<? extends PrismContainerValue<?>> vi = values.iterator();
while (vi.hasNext()) {
PrismContainerValue<?> cval = vi.next();
List<Item<?,?>> subitems = cval.getItems();
if (subitems != null && !subitems.isEmpty()) { // second condition is to prevent removal of originally empty values
if (subitems != null) {
applySecurityConstraints(subitems, securityConstraints, subDefaultReadDecision, itemAddDecision, itemModifyDecision, phase);
if (subitems.isEmpty()) {
vi.remove();
}
}
}
if (!itemWasEmpty && item.isEmpty()) {
iterator.remove();
}
}
} else {
if (itemReadDecision == AuthorizationDecisionType.DENY || (itemReadDecision == null && defaultReadDecision == null)) {
Expand Down

0 comments on commit 79d0c4d

Please sign in to comment.