Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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.addWarning(LOG, "Skipped ACE for path " + path + " and principal " + aceBean.getPrincipalName()
+ " 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 @@ -27,7 +27,7 @@
public class AuthorizablesConfig extends LinkedHashSet<AuthorizableConfigBean> {
private static final long serialVersionUID = -253685832563496002L;

private Map<String, AuthorizableConfigBean> configBeansByPrincipalId = new HashMap<>();

Check warning on line 30 in accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configmodel/AuthorizablesConfig.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make this private field "final", it is never reassigned.

See more on https://sonarcloud.io/project/issues?id=Netcentric_accesscontroltool&issues=AaGIMeTABwBJuTFYhqgy&open=AaGIMeTABwBJuTFYhqgy&pullRequest=924

@Override
public boolean add(AuthorizableConfigBean configBean) {
Expand Down Expand Up @@ -86,4 +86,9 @@
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
Loading