I have pretty much the same issue that is described here:

https://www.drupal.org/node/1492118

That issue is for the D7 version though. I am running D8 with the 8.x-1.1 version of this module. We have two roles that should have the ability to view/edit any unpublished content. These roles cannot see any unpublished content unless we give them the "bypass content access restriction," which we don't want to do.

Any help is appreciated. Thanks.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

maxq10 created an issue. See original summary.

scookie’s picture

We have this same issue, and it's a showstopper. If users other than authors cannot view and work with unpublished content, then there is no point in having a workflow.

I also noted that when there is an unpublished version of a published node, users other than authors CAN view that unpublished version. It seems to be only when a node hasn't been published yet that users with the "View unpublished content" permission cannot see it.

We are using Content Moderation.

L-four’s picture

While workbench_moderation implements the hook_node_access, views(content overview pages) don't utilize this hook to check access but it uses the sql tag node_access to control access to content. The node_access tag is part of the node grants system. (https://www.phase2technology.com/blog/drupal-7-node-access-grants-locks-...).

In this patch I have implemented hook_node_access_records to add access records for unpublished nodes and the corresponding hook_node_grants hook to give users with the permission "View All Unpublished Content" a grant for the access records.

For this patch to work you will need to clear your cache and rebuild the permissions /admin/reports/status/rebuild

Status: Needs review » Needs work

The last submitted patch, 3: workbench_moderation-node_grants-2835883-3-D8.patch, failed testing.

elimw’s picture

Hi L-four,

I've tried applying your patch in #3, cleared cache and rebuild permissions as per your instructions but still couldn't see other users's unpublished content.

elimw’s picture

From what I can tell, Drupal does not let non-admins view the unpublished content of other users, only their own.

To enable this functionality, you will need to install the View Unpublished contrib module - https://www.drupal.org/project/view_unpublished

recrit’s picture