[PP-1] Add a selection handler to content_moderation that respects 'view any unpublished content'

Created on 2 January 2018, about 7 years ago
Updated 28 February 2025, 7 days ago

Problem/Motivation

At present it is possible to grant users the permission to view any unpublished content when content moderation module is enabled.
However the default node entity reference selection handler excludes users from viewing/referencing unpublished items if the user does not have the 'bypass node access' permission.

Proposed resolution

Add a new entity reference selection handler for node entities to content_moderation module that takes into account the 'view any unpublished content' permission.
Add tests to verify that users with that permission but without bypass node access permission can reference unpublished content.
Verify that adding this handler to content moderation does not break if node module is disabled, as content moderation does not have a hard dependency on node module.
If it does, it might be that we need an alter hook to change the class used, replacing the default NodeSelection class.

Remaining tasks

The lot

User interface changes

None

API changes

None

Data model changes

✨ Feature request
Status

Postponed

Version

11.0 πŸ”₯

Component

content_moderation.module

Created by

πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

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