Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,15 @@ public void installPathBasedACEs(
// order entries (denies in front of allows)
final Set<AceBean> orderedAceBeanSetFromConfig = new TreeSet<AceBean>(
new AcePermissionComparator());
orderedAceBeanSetFromConfig.addAll(aceBeanSetFromConfig);
for (AceBean aceBean : aceBeanSetFromConfig) {
if (acConfiguration.getAuthorizablesConfig().managesPathForPrincipal(path, aceBean.getPrincipalName(),
acConfiguration.getGlobalConfiguration().getDefaultUnmanagedAcePathsRegex())) {
orderedAceBeanSetFromConfig.add(aceBean);
} else {
history.addMessage(LOG, "Skipped ACE for path " + path + " and principal " + aceBean.getPrincipalName()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Turn this into a warning

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 0786f01: the skip is now logged with addWarning.

+ " as the path matches unmanagedAcePathsRegex");
}
}

Set<String> principalsToRemoveAcesForAtThisPath = acConfiguration.getAuthorizablesConfig()
.removeUnmanagedPrincipalNamesAtPath(path, principalsToRemoveAcesFor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,9 @@ public Set<String> removeUnmanagedPrincipalNamesAtPath(String path, Set<String>
return filteredPrincipals;
}

public boolean managesPathForPrincipal(String path, String principal, String defaultUnmanagedAcePathsRegex) {
AuthorizableConfigBean authorizableConfig = configBeansByPrincipalId.get(principal);
return authorizableConfig == null || authorizableConfig.managesPath(path, defaultUnmanagedAcePathsRegex);
}

}
2 changes: 1 addition & 1 deletion docs/AdvancedFeatures.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ Additionally, it is also possible to set `unmanagedExternalIsMemberOfRegex` and

### Limiting where the AC Tool creates and removes ACEs

The property `unmanagedAcePathsRegex` for authorizable configurations (users or groups) can be used to ensure certain paths are not managed by the AC Tool. This property must contain a regular expression which is matched against all ACE paths bound to the authorizable found in the system. All ACEs with matching paths are not touched. By setting the global config `defaultUnmanagedAcePathsRegex` it is possible to exclude certain areas of the JCR totally from removing (and creating once #244 is fixed) at all.
The property `unmanagedAcePathsRegex` for authorizable configurations (users or groups) can be used to ensure certain paths are not managed by the AC Tool. This property must contain a regular expression which is matched against all ACE paths bound to the authorizable found in the system. All ACEs with matching paths are not touched. By setting the global config `defaultUnmanagedAcePathsRegex` it is possible to exclude certain areas of the JCR totally from removing and creating at all.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarify that this never impacts repository wide permissions.


#### Examples

Expand Down