Control placement of inline blocks

Created on 14 October 2019, about 5 years ago
Updated 2 April 2023, over 1 year ago

Problem/Motivation

Currently, Layout Builder Restrictions is unable to control the placement of Inline Blocks. That ability is solely controlled by the 'Create and edit custom blocks' permission, which was added in #2914486: Add granular permissions to the Layout Builder β†’ . The UI and configuration are already in place.

Proposed resolution

It looks like we'll need to override the ChooseBlockController controller and modify the $build array returned by both ChooseBlockController::build() and ChooseBlockController::inlineBlockList().

The 'Create and edit custom blocks' permission will still be required. We'll want to document that.

Remaining tasks

  • Community review

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

Beginning with release 8.x-2.3, restrictions to inline block are now applied. In previous versions, restrictions to inline block were not applied and were controlled by the 'Create and edit custom blocks' permission. This permission is provided by core but does not provide per-bundle granularity. In the current release, this permission is still necessary; however, it is now possible to control which block types are allowed for a given view mode with Layout Builder Restrictions.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Chris Burge

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024