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
- On an unpublished node, go to the "node access" config, check the "view" checkbox and save.
- Rebuild the permissions.
- With a simple user Authenticated visit the unpublished node. I will see it but you should not...
Proposed resolution
Two solutions:
- Add new grants on view, edit, delete for unpublished nodes
- Just add a check on unpublished nodes iin the hook_node_access_records and return the "default" grants.
Remaining tasks
- Patch (Done for second solution)
- Tests
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3519063-global-check-unpublished-permission.patch.txt | 764 bytes | redzeuf |
Comments
Comment #2
redzeufJust adding a patch for the second solution. Globally without all the grant option.
It's enough IMO.
Comment #3
redzeufPrevious patch was not applicable. Just reviewed the path to the module
Comment #4
redzeufMy second patch was also wrong... Apologize