Problem/Motivation

Node unpublished are shown to user regarding the rule defined in the nodeaccess config. But unublished content not be displayed to users if they don't have a specific permission. That's a privilege for Editors and admins.

Steps to reproduce

  1. On an unpublished node, go to the "node access" config, check the "view" checkbox and save.
  2. Rebuild the permissions.
  3. With a simple user Authenticated visit the unpublished node. I will see it but you should not...

Proposed resolution

Two solutions:

  1. Add new grants on view, edit, delete for unpublished nodes
  2. Just add a check on unpublished nodes iin the hook_node_access_records and return the "default" grants.

Remaining tasks

  1. Patch (Done for second solution)
  2. Tests

Comments

redzeuf created an issue. See original summary.

redzeuf’s picture

Issue summary: View changes
StatusFileSize
new904 bytes

Just adding a patch for the second solution. Globally without all the grant option.
It's enough IMO.

redzeuf’s picture

Previous patch was not applicable. Just reviewed the path to the module

redzeuf’s picture

StatusFileSize
new764 bytes

My second patch was also wrong... Apologize