Support "View any unpublished [entity_type]" and "Administer [entity_type]" permissions

Created on 22 July 2020, about 4 years ago
Updated 9 August 2024, 30 days ago

Postponed on 📌 Introduce entity permission providers Needs work

Problem/Motivation

Content moderation is not all about nodes since it is quite easy creating a custom content entity and make sure content moderation works on that. The module also introduces a "Latest version" local task on moderated entities, but in the related \Drupal\content_moderation\Access\LatestRevisionCheck access checker only validates if the current user has view (any/own) unpublished content permission, which only applies to nodes...

Proposed solution

Check the type of the entity object and only apply view (any/own) unpublished content when the type of the object is NodeInterface, otherwise use the view (any/own) unpublished [entity_type] permission, which may or may not exists.

Update: assumption: it should also respect the "administer [entity_type]" permission.

Related issues

There is a currently open patch in the Entity API module that would introduce a view any unpublished [entity_type] permission, view own is already supported. Add: "View any unpublished [entity_type]" permission [#3023527] Add: "View any unpublished [entity_type]" permission Needs review

There are several open content moderation issues related to this problem as of today:

  1. Move permission "view any unpublished content" from Content Moderation to Node [#273595] Move permission "view any unpublished content" from Content Moderation to Node Postponed
  2. Add per-bundle unpublished content permissions [#2875867]
  3. Add a "view any unpublished media" permission [#2936652] Add "view unpublished $bundle media" permissions for each media bundle Postponed
🐛 Bug report
Status

Postponed

Version

11.0 🔥

Component
Content moderation 

Last updated 1 day ago

Created by

🇭🇺Hungary mxr576 Hungary

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.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

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.

  • 🇦🇺Australia pameeela

    @mxr576 is this something you are still interested in? I think the issue summary needs to be updated based on your most recent comments, but it also sounds like this might be a task or two rather than a bug?

    Either way if you could provide some more information this is more likely to progress.

  • Status changed to Postponed 30 days ago
  • 🇩🇪Germany Anybody Porta Westfalica

    I think this should be postponed on 📌 Introduce entity permission providers Needs work for now.

Production build 0.71.5 2024