Block types should grant bundle-specific permissions

Created on 19 August 2024, 3 months ago

Problem/Motivation

Blocks don’t mark their permissions as granular as nodes, media, and taxonomies do. It is most likely an oversight.

\Drupal\Core\Entity\EntityTypeInterface::getPermissionGranularity().

This issue arose from the Recipes channel of the Drupal slack. Credit should be given to imalabya for the question and solution, and phenaproxima for direction and ridiculous knowledge!

If this change is made, then the grantPermissionsForEach[entity] config action would also work for content blocks.

grantPermissionsForEachBlockContentType:
  - "create %bundle block content"

Proposed resolution

Add permission_granularity = "bundle", to Drupal\block_content\Entity\BlockContent.php

Remaining tasks

User interface changes

N/A

Introduced terminology

Would create grantPermissionsForEachBlockContentType config action.

API changes

N/A

Data model changes

N/A

Release notes snippet

TBD

πŸ› Bug report
Status

Closed: duplicate

Version

11.0 πŸ”₯

Component
Block contentΒ  β†’

Last updated 4 days ago

Created by

πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024