Skip to content

Commit

Permalink
KYLO-3005: Fixed broken unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
felten committed Nov 16, 2018
1 parent 73f4c51 commit 3307218
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,14 @@ public void checkPermission(Set<Action> actions) {
}
}
}

public void removeAccessControl(Principal owner) {
disableAccessControl(owner);
JcrUtil.getNodesOfType(getNode(), JcrAllowableAction.NODE_TYPE).forEach(JcrUtil::removeNode);
}

public void disableAccessControl(Principal owner) {
JcrAccessControlUtil.clearRecursivePermissions(getNode(), JcrAllowableAction.NODE_TYPE);
JcrAccessControlUtil.clearPermissions(getNode());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,15 @@ default void disableAccessControl(Principal owner, List<SecurityRole> roles) {
}

JcrAllowedActions allowed = getJcrAllowedActions();
allowed.removeAccessControl(owner);
allowed.disableAccessControl(owner);
JcrAccessControlUtil.clearPermissions(getNode());
}

default void clearAccessControl() {
disableAccessControl(getOwner());
JcrAllowedActions allowed = getJcrAllowedActions();
allowed.removeAccessControl(getOwner());
}

default void enableAccessControl(JcrAllowedActions prototype, Principal owner, List<SecurityRole> roles) {
JcrAllowedActions allowed = getJcrAllowedActions();
Expand Down

0 comments on commit 3307218

Please sign in to comment.