Skip to content

Add field access checks before activating editable elements#34

Merged
formfcw merged 1 commit intomainfrom
florian/field-permission-check
Feb 27, 2026
Merged

Add field access checks before activating editable elements#34
formfcw merged 1 commit intomainfrom
florian/field-permission-check

Conversation

@formfcw
Copy link
Copy Markdown
Collaborator

@formfcw formfcw commented Feb 24, 2026

Scope

What's changed:

  • Editable elements now go through a two-phase lifecycle: lightweight construction → activate() (overlay, observers, listeners) only after permission check
  • apply() sends a checkFieldAccess message to the parent Directus frame with collection/item/fields for each new element
  • Parent responds with activateElements containing keys of permitted elements — only those get activated
  • New types: CheckFieldAccessData, new actions: checkFieldAccess (send) / activateElements (receive)

Potential Risks / Drawbacks

  • Breaking change: elements won't show edit overlays unless the parent frame responds to checkFieldAccess with activateElements — requires Directus
    v11.16.0+
  • This might warrant bumping to v2.0.0 given the breaking nature

Review Notes / Questions

Copy link
Copy Markdown

@robluton robluton left a comment

Choose a reason for hiding this comment

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

LGTM 🎸

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.

2 participants