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
Create a permission by display builder config entity so it can be attached to roles. Like what is done by "filter" module.
Then, everywhere display builder is available (entity view, overrides, page layout, views...), propose a list of the builders available to the current user, similar to the text format selector in Long Text fields.
It is also the opportunity to:
- centralize the display builder selector generation instead of having it spread between
ViewsDisplayExtenderand the 2DisplayVariant, once #3534335: Align config storage properties is merged and before #3534215: Implement WithDisplayBuilderInterface in Views is started - removing "Access display builder API" permission which is always checked with "administer display builders". Jean has confirmed it was added to implement a mechanism which has been cancelled later.
Issue fork display_builder-3529129
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
pdureau commentedJean'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`.
Comment #3
mogtofu33 commentedComment #4
mogtofu33 commentedComment #5
mogtofu33 commentedComment #6
pdureau commentedComment #7
pdureau commentedComment #8
mogtofu33 commentedDB 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
Comment #9
pdureau commentedFilter module permissions, for information:
Comment #10
pdureau commentedComment #11
pdureau commentedComment #12
pdureau commentedComment #13
pdureau commentedI start it, as a follow-up of #3534335: Align config storage properties.
Comment #15
pdureau commentedWhat do you think about the logic in
ConfigFormTrait::buildConfigForm()It was not discussed.
Comment #16
mogtofu33 commentedComment #17
pdureau commentedJean & Pierre's proposal:
Comment #18
pdureau commentedI will do the change
Comment #19
pdureau commentedComment #20
mogtofu33 commented