Skip to content

feat: per-form permission granularity (PRO)#5

Merged
andrii-trush merged 2 commits into
mainfrom
feature/per-form-permissions
Feb 18, 2026
Merged

feat: per-form permission granularity (PRO)#5
andrii-trush merged 2 commits into
mainfrom
feature/per-form-permissions

Conversation

@andrii-trush
Copy link
Copy Markdown
Member

Summary

  • Registers a per-form permission view decrypted {form-handle} sensitive fields using Statamic's native {placeholder} + replacements() mechanism (same pattern as view {collection} entries)
  • The existing global permission view decrypted sensitive fields becomes a wildcard — fully backward-compatible; no role changes required for existing installations
  • isAuthorized() renamed to isAuthorizedForForm(string $formHandle) in both DecryptingSubmissionRepository and DecryptingSubmissionQueryBuilder; checks global permission first, then per-form

Test plan

  • All 32 existing tests pass (vendor/bin/phpunit)
  • New test: per-form permission grants decrypted access to the correct form
  • New test: per-form permission does not grant access to other forms (scope isolation)
  • Manual: open CP → Users → Roles, confirm per-form permission entries appear per registered form
  • Manual: assign per-form role to a user, confirm they see plaintext in one form and •••••• in another

Register a per-form permission `view decrypted {form} sensitive fields`
using Statamic's native placeholder + replacements() mechanism. The
global permission `view decrypted sensitive fields` acts as a wildcard
(backward-compatible). Both DecryptingSubmissionRepository and
DecryptingSubmissionQueryBuilder check global then per-form in the
renamed isAuthorizedForForm(string $formHandle) method.

Adds 2 feature tests covering grant and scope isolation. Updates all
relevant docs.
@andrii-trush andrii-trush merged commit 412d40b into main Feb 18, 2026
4 checks passed
@andrii-trush andrii-trush deleted the feature/per-form-permissions branch February 18, 2026 08:58
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.

1 participant