As of Drupal 10.1.x-dev, this module is no longer needed and the "Block Content" core module's permissions can be used instead. See migration notes below.

The Block Content Permissions module allows you to control access to administer block content types (custom block types), administer block content (custom block library), and create, update, or delete specific types of block content.

This module removes the required "Administer blocks" permission from all block content and block content type pages except for the "Custom block library - Blocks" views page. There is an open issue for the remaining page. [2920739]

The following permissions are added:

Administer block content types
Grants access to manage block content types.
Permissions for each block content type
Grants access to manage block content for a given
type:
  • [type]: Create new block content
  • [type]: Delete any block content
  • [type]: Edit any block content
View restricted block content
Grants access to view restricted block content that the user cannot manage on the Custom block library page. Otherwise, list only contains types the user can create, delete, or edit.

Installation and Setup

  1. Install the module as you normally would any module.
  2. Assign permissions created by this module to grant access. Adding or removing block content types (custom block types) after enabling this module will automatically update on the permissions page.
  3. Add the following permissions to allow access to edit blocks in-place (on-page):
  4. Add the following permission to allow access to menus related to administering blocks:
    • Use the administration pages and help
  5. Add the following permission to allow access to the "Custom block library - Blocks" page:
    • Administer blocks

Note: The "Administer blocks" permission also grants full access to all pages related to "Block Layout". To restrict access to those pages, you can use the Block Region Permissions module.

How to migrate to core permissions

As of Drupal 10.1.x-dev, this module is no longer needed. To switch to the "Block Content" core module's permissions, migrate and setup new permissions (see below), disable this module, test, and uninstall this module.

Note, the "Structure > Custom blocks" page moved to "Content > Blocks".

Disable the "Administer blocks" permission for roles that shouldn't access the "Block layout" page, which was previously needed to do anything with custom blocks.

Enable the "Administer block types" permission for roles that have this module's "Administer block content types" permission set.

Enable the "Access the Content blocks overview page" permission for roles that should access the "Blocks" page. Note, this is needed for UI navigation related to create, delete, and edit permissions.

Enable the "Administer block content" permission for roles that should create, delete, edit, and revert [all] custom blocks for all types.

(Skip for roles with the "Administer block content" permission enabled.) Enable permissions for roles that should create, delete, edit, or revert [some] custom blocks. Note, the "View custom block history pages" permission is needed for UI navigation related to the revert permission.

  • [type]: Create new content block (<<< [type]: Create new block content)
  • [type]: Delete content block (<<< [type]: Delete any block content)
  • [type]: Edit content block (<<< [type]: Edit any block content)
  • [type]: Revert content block revisions
  • [type]: View content block history pages

 

As of Drupal 10.1.x-dev, this module is no longer needed. For more info, see #1975064: Add more granular block permissions.

Project information

Releases