Add "edit block $type" permissions

Created on 30 September 2016, about 8 years ago
Updated 15 February 2023, almost 2 years ago

Problem/Motivation

This issue follows up on the discussion in Add more granular block content permissions Fixed

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.

Add more granular block content permissions Fixed 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.

larowlan and Tim Plunket in #98 proposed to also add a "create blocks" permission as part of this issue because that would be useful for Layout builder.

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

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.

Feature request
Status

Fixed

Version

10.1

Component
Block content 

Last updated 16 days ago

Created by

🇳🇱Netherlands ifrik

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

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