[1.0.0-alpha2] Display Builder availability according to roles or permissions

Created on 9 June 2025, 28 days ago

Problem/Motivation

We can create many Display Builder config entities, with different config (which islands? where? which island config?): one for contributors, one for administrators, one for devel/debug, ones for some specific use cases...)

However, this mechanism is not complete without a contextualisation of this choice.

Proposed resolution

What do we do? We create a permission by display builder entity so it can be attached to roles?

Or do we do like Text Formats and Views ? A direct reference to User Roles entities ?

Then, everywhere display builder is available (entity view, overrides, page layout, views...), propose a list of the builders available to the current user.

So, would it be similar to the text format selector in Long Text fields?

Feature request
Status

Active

Version

1.0

Component

Main & misc

Created by

🇫🇷France pdureau Paris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @pdureau
  • 🇫🇷France pdureau Paris

    Jean's notes:

    Have dynamic config available to the instanciation of display builder `stateManager::create()` and to the user using the display builder.
    So config should be permission based. Each config have a `use` permission.

    Implementation

    For each instance associated with entity / page / views we should store a default config, when using `stateManager::create()` with fallback to default.
    This value is stored as `entity_config_id` on the storage, it's a default value for this display builder.

    Display builder UX

    Have a switch of display builder config when on a display builder, only available the one with current user permission and default to the default one set in state storage `entity_config_id`.

  • 🇫🇷France mogtofu33

    DB config, one global permission 'administer display builders' to create / edit Delete
    For each DB config, one usage permission (as filter module):
    Use the %name Display builder config

  • 🇫🇷France pdureau Paris

    Filter module permissions, for information:

    administer filters:
      title: 'Administer text formats and filters'
      description: 'Define how text is handled by combining filters into text formats.'
      restrict access: true
    
    permission_callbacks:
      - Drupal\filter\FilterPermissions::permissions
Production build 0.71.5 2024