Problem/Motivation
We currently have granular inline block permissions in Drupal, allowing to precisely set which custom block bundles can be created / edited by which user role. Unfortunately, restricting access to certain custom block types doesn't work in Layout Builder that allows to add / edit all or nothing within a layout by design.
Proposed resolution
- Add a new permission
create and edit accessible custom blocks
. - Restrict custom blocks list in LB to only those accessible ones for users having only that permission and not
create and edit custom blocks
- Alter LB block add, edit and delete route access basing on custom block permissions for the current user and the old / new permission.
- (Of course) Add automated test coverage.
- Create a follow-up to remove the old permission and make LB always respect block access logic or at least mark the old permission with
restrict access: true