Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I tried creating a view where I display user's unpublished nodes.
The view works flawlessly for super user 1, but it doesn't work for authenticated users where no nodes are displayed though the authenticated user can directly access the unpublished node and edit it.
Things I tried:
1. Try different display formats (e.g. fields, full content)
2. Removed all kinds of filters
3. Removed all kinds of access rules for the view
4. Reviewed permissions:
- Administer content is unchecked for authenticated user
- View own unpublished content is checked for authenticated user
- create/edit/delete content permissions are set for authenticated user
- Bypass content access control unchecked for authenticated user
Is this normal or this is a views' bug?
Comment | File | Size | Author |
---|---|---|---|
#6 | unpublished-with-filter.yml | 8.73 KB | Lendude |
#4 | unpublished.yml | 7.95 KB | Ismail Cherri |
Comments
Comment #2
cilefen CreditAttribution: cilefen commentedHello Ismail Cherri,
Would you please attach the configuration export of the view and attach it?
Comment #3
dawehnerComment #4
Ismail Cherri CreditAttribution: Ismail Cherri as a volunteer commentedHi,
I've created a new clean installation. I created a new view for unpublished content.
Now, the authenticated user can see all the unpublished content regardless of the permission.
I attached the created view.
Many thanks
Ismail
Comment #5
Ismail Cherri CreditAttribution: Ismail Cherri as a volunteer commentedComment #6
LendudeWe don't track node access for viewing unpublished content, so (un)published viewing permissions don't get applied like other node access things, you have to set everything up manually.
In this case you have to add a contextual filter that filters on the current user along with the normal published = false filter you had already.
If you want to know why it's not tracked, somewhere in the middle of #273595: Move permission "view any unpublished content" from Content Moderation to Node there is some reasoning for that.