-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a new condition to identify when a everyone deny is found and … #677
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,7 +82,8 @@ protected void installAcl(Set<AceBean> aceBeanSetFromConfig, String path, Set<St | |
int currentPositionConfig = 0; | ||
|
||
boolean changeHasBeenFound = false; | ||
|
||
boolean everyoneDenyFound = false; | ||
|
||
AccessControlManager acMgr = session.getAccessControlManager(); | ||
|
||
JackrabbitAccessControlList acl = getAccessControlList(acMgr, path); | ||
|
@@ -97,6 +98,12 @@ protected void installAcl(Set<AceBean> aceBeanSetFromConfig, String path, Set<St | |
if (!principalsInConfiguration.contains(acePrincipalName)) { | ||
countOutsideConfig++; | ||
diffLog.append(" OUTSIDE (not in Config) " + actualAceBeanCompareStr + "\n"); | ||
// Condition will check if everyone deny was added at the bottom, blocking all permissions created by actool | ||
// usually happens when SP installs some rep:policy nodes | ||
if ((acl.size() - countOutsideConfig <= configuredAceEntries.size()) | ||
&& (StringUtils.startsWith(actualAceBeanCompareStr, "everyone") && StringUtils.contains(actualAceBeanCompareStr, "deny"))) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please act on |
||
everyoneDenyFound = true; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a test case for that condition? |
||
} | ||
continue; | ||
} | ||
|
||
|
@@ -134,6 +141,18 @@ protected void installAcl(Set<AceBean> aceBeanSetFromConfig, String path, Set<St | |
|
||
} | ||
|
||
// will override the logic to apply all ACLs on the path, and removing all elements present in config files | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wouldn't it make more sense that instead of reapplying everything just reorder the deny? |
||
if (everyoneDenyFound && !changeHasBeenFound) { | ||
Iterator<AccessControlEntry> items = Arrays.asList(acl.getAccessControlEntries()).iterator(); | ||
while (items.hasNext()) { | ||
AccessControlEntry currentEntry = items.next(); | ||
if (principalsInConfiguration.contains(currentEntry.getPrincipal().getName())) { | ||
acl.removeAccessControlEntry(currentEntry); | ||
} | ||
} | ||
currentPositionConfig = 0; | ||
} | ||
|
||
// install missing - this can be either because not all configured ACEs were found (append) or because a change was detected and old | ||
// aces have been deleted | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how this condition checks the position of the everyone deny (what is stated in the comment), or is
everyoneDenyFound
alwaystrue
irrespective of the position of the deny for everyone?