Returning AccessResult::forbidden() in entity hooks makes it impossible to override access

Created on 4 May 2020, almost 5 years ago
Updated 10 April 2024, about 1 year ago

Problem/Motivation

Returning AccessResult::forbidden() means that no other module can have a say over access due to forbidden overriding all other access results. This module should be returning neutral instead.

Proposed resolution

Use AccessResult::allowedIfHasPermission in block_content_permissions_block_content_type_access and block_content_permissions_block_content_create_access

Found when trying to fix the core bug 🐛 Block content permissions required to select or upload new Media with media library when using Layout Builder Active

🐛 Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

🇦🇺Australia acbramley

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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