Skip to content

Reveal glob and strict markers in ACL permissions logs - #338

Open
dprzybyl wants to merge 1 commit into
wttech:mainfrom
dprzybyl:feature/issue-307-strict-glob-logging
Open

dprzybyl wants to merge 1 commit into
wttech:mainfrom
dprzybyl:feature/issue-307-strict-glob-logging

Conversation

@dprzybyl

@dprzybyl dprzybyl commented Oct 26, 2026 •

Copy link
Copy Markdown

Summary

  • Every ACL permissions log line (Applied/Skipped setting/Checked/Cleared/Skipped clearing) now carries a trailing modifier when applicable: " with glob 'STRICT'" / " with glob '<pattern>'" for apply/check sites, " in strict mode" for clear sites. Suffix sits between the main sentence and any trailing (reason) parenthetical, so parsers matching the pre-existing no-glob/no-strict case still work.
  • AclChecker.check log reshaped from ...with allow 'true' [result] to Checked allow permissions ... with glob 'X' [result] so the glob suffix does not stack a second with on top of the allow modifier, matching the write-path Applied allow permissions ... format.
  • New determineGlobSuffix() method on both authorizable.PermissionsOptions and check.PermissionsOptions reconstructs the "STRICT" display name from the internally empty GLOB_STRICT_EFFECTIVE marker; API script catalog regenerated.

Example log output

Before:

Applied allow permissions for authorizable 'XYZ' at path '/content/your_project/abc'
Applied deny permissions for authorizable 'XYZ' at path '/content/your_project/ab/cd'

After:

Applied allow permissions for authorizable 'XYZ' at path '/content/your_project/abc'
Applied deny permissions for authorizable 'XYZ' at path '/content/your_project/ab/cd' with glob 'STRICT'
Checked allow permissions for authorizable 'XYZ' at path '/content' with glob 'STRICT' [true]
Cleared permissions for authorizable 'XYZ' at path '/content' in strict mode
Skipped clearing permissions for authorizable 'XYZ' at path '/content' in strict mode (path not found)

Test plan

  • mvn -pl core compile spotless:check passes locally
  • Groovy probe script exercising every log variant (allow/deny with STRICT/pattern/no-glob, path-not-found, authorizable-not-found, already-set, check [true], clear strict/non-strict, clear skip variants) produces all 15 expected lines end-to-end against local AEM
  • CI (Spotless + build) green on the branch
  • Reviewer: skim 11 log sites across AclAuthorizable, Acl, AclChecker to confirm the glob/strict suffix lands between path and reason

Closes #307

The "Applied allow/deny permissions" and "Checked permissions" lines were
visually indistinguishable when the same authorizable received multiple
calls at the same (or overlapping) paths - the glob restriction, including
the STRICT one meant to lock a single node, was not visible, so operators
had to cross-check the script source to tell apart a wide-tree grant from
a single-node protect. The "Cleared permissions" lines carried the same
blind spot for the clear(..., strict) flag that chooses between selective
and full removal.

Every ACL permissions log line now carries a trailing modifier when it
applies:

  Applied allow permissions for authorizable 'X' at path '/foo' with glob 'STRICT'
  Skipped setting deny permissions for authorizable 'X' at path '/foo' with glob 'STRICT' (already set)
  Checked allow permissions for authorizable 'X' at path '/foo' with glob 'STRICT' [true]
  Cleared permissions for authorizable 'X' at path '/foo' in strict mode
  Skipped clearing permissions for authorizable 'X' at path '/foo' in strict mode (path not found)

Suffixes always sit between the main sentence and any trailing
"(reason)" parenthetical, so parsers that match the pre-existing format
(no glob, no strict) continue to work unchanged.

Covered log sites:

- AclAuthorizable.apply - four lines (Applied, Skipped composite node
  store, Skipped path not found, Skipped already set)
- Acl.apply - "authorizable not found" variant
- AclAuthorizable.clear - four lines (Cleared, Skipped composite node
  store, Skipped path not found, Skipped no permissions to clear)
- Acl.clear - "authorizable not found" variant
- AclChecker.check - the single "Checked permissions" line; its template
  is reshaped from "...with allow 'true' [...]" to
  "Checked allow permissions..." so that the glob suffix does not stack
  a second "with" on top of the allow one, matching how the write-path
  Applied line is written

The glob suffix is produced by a new determineGlobSuffix method on both
authorizable.PermissionsOptions and check.PermissionsOptions - the two
options classes stay symmetric, the STRICT display string is
reconstructed from the internally empty GLOB_STRICT_EFFECTIVE marker in
one place, and the three call sites just concatenate the already-formed
suffix instead of re-wrapping the raw value. The strict suffix is a
local " in strict mode" phrase in AclAuthorizable.clear and Acl.clear
driven by ClearOptions.isStrict() / the clear(path, strict) boolean.

The regenerated api.md / api.json script catalog therefore lists
determineGlobSuffix next to the existing determineAll* methods on both
options classes.

Closes wttech#307
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

More explicit "STRICT glob" permissions logging

1 participant