Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#3 | workbench_moderation-node_grants-2835883-3-D8.patch | 1.57 KB | L-four |
Comments
Comment #2
scookie CreditAttribution: scookie at Workday, Inc. commentedWe 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.
Comment #3
L-four CreditAttribution: L-four commentedWhile 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
Comment #5
elimw CreditAttribution: elimw commentedHi 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.
Comment #6
elimw CreditAttribution: elimw commentedFrom 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
Comment #7
recrit CreditAttribution: recrit commentedRelated issue #2919729: Update access is broken on sites using node access records and node grants.