Problem/Motivation
This issue follows up on the discussion in #1975064: Add more granular block permissions
Custom blocks can be created as structural page elements and content editors might need to edit their content on a production site. For example, a block with opening times placed on the front page: Editors should not be able to move it, but might need to change it to add special opening times.
Currently, users need "Administer blocks" permissions to do such a purely content change that doesn't even change the configuration. However, this also gives them the permission to change the whole block layout, remove or delete blocks etc.
#1975064: Add more granular block permissions discusses more granular block permissions in general, but just adding a separate permission to edit existing custom blocks would already be a big improvement for user experience for content editors and for sitebuilders setting up the sites for such roles.
Proposed resolution
Add an edit block permission per block type.
Provide an easy way for users with the new permission to reach the block-edit form.
Completed tasks
- Write a patch.
- Update the patch as requested in Comment #32 (numbered points). (done by #50)
- Add tests. (done by #56 & #58)
- Create an issue to fix the early return in
BlockContentAccessHandlerTest::providerTestAccess()
(done by #3022183). - Write a change notice.
- Make updates as discussed in #94 - #96.
- Make sure that users with permission to edit a block can use the edit (contextual) link when the block is viewed. (confirmed via manual testing)
- UI tests for edit/create permissions
Remaining tasks
- Allow users with the
create $type block content
permission to create blocks via /block/add route as per #106 - Review and commit.
User interface changes
- Users with the new permission will be able to use the edit links on the "front end" of the site.
API changes
TBD.