Skip to content

Skip creating ACEs on paths matching an authorizable's unmanagedAcePathsRegex - #924

Merged
kwin merged 4 commits into
developfrom
copilot/fix-unmanaged-ace-paths-regex-evaluation
Oct 29, 2026
Merged

kwin merged 4 commits into
developfrom
copilot/fix-unmanaged-ace-paths-regex-evaluation

Conversation

Copilot AI commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

unmanagedAcePathsRegex (per authorizable) and defaultUnmanagedAcePathsRegex (global) were only honoured when removing ACEs. ACEs from the config were still written to paths the regex marks as unmanaged. This contradicted the docs, which said creation would be covered once #244 was fixed.

  • Installer (BaseAceBeanInstaller)

    • Before an ACL is installed for a path, config ACEs are now filtered per principal.
    • If the principal's regex (or the global default) matches the path, that ACE is skipped and a verbose log line is written.
    • The removal side already used the same check, so creation and removal now agree.
  • Config model (AuthorizablesConfig)

    • Added managesPathForPrincipal(path, principal, defaultRegex).
    • Principals not in the config, such as migrateFrom sources, are treated as managed. This matches the existing removeUnmanagedPrincipalNamesAtPath behaviour.
  • Docs (AdvancedFeatures.md)

- group-a:
    - name: group-a
      unmanagedAcePathsRegex: /content/dam/.*

ACEs for group-a under /content/dam/** in the config are no longer created or removed.

Review notes

  • I left the purge check in AcInstallationServiceImpl (skip purging when the regex is non-blank) unchanged. Purging deletes the whole authorizable rather than individual ACEs, so a path-level regex can't be applied there.
  • No automated tests were added or run, because the Maven build couldn't resolve its dependencies offline in my environment.

Co-authored-by: kwin <185025+kwin@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix evaluation of unmanagedAcePathsRegex in group config Skip creating ACEs on paths matching an authorizable's unmanagedAcePathsRegex Oct 29, 2026
Copilot AI requested a review from kwin October 29, 2026 13:18
acConfiguration.getGlobalConfiguration().getDefaultUnmanagedAcePathsRegex())) {
orderedAceBeanSetFromConfig.add(aceBean);
} else {
history.addVerboseMessage(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 Since this is probably not intended it should be logged even outside verbose.

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 d1b445f: the skip is now logged with addMessage instead of addVerboseMessage, so it appears outside verbose mode.

Comment thread docs/AdvancedFeatures.md
### 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.

Co-authored-by: kwin <185025+kwin@users.noreply.github.com>
Copilot AI requested a review from kwin October 29, 2026 15:17

@kwin kwin left a comment

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.

@

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.

Co-authored-by: kwin <185025+kwin@users.noreply.github.com>
@kwin
kwin marked this pull request as ready for review October 29, 2026 15:43
@sonarqubecloud

Copy link
Copy Markdown

@kwin
kwin merged commit 3454b9b into develop Oct 29, 2026
14 checks passed
@kwin
kwin deleted the copilot/fix-unmanaged-ace-paths-regex-evaluation branch October 29, 2026 16:16
@kwin kwin added this to the 4.2.5 milestone Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants