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?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Ismail Cherri created an issue. See original summary.

cilefen’s picture

Hello Ismail Cherri,

Would you please attach the configuration export of the view and attach it?

dawehner’s picture

Status: Active » Postponed (maintainer needs more info)
Ismail Cherri’s picture

FileSize
7.95 KB

Hi,
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

Ismail Cherri’s picture

Status: Postponed (maintainer needs more info) » Needs review
Lendude’s picture

Status: Needs review » Closed (works as designed)
FileSize
8.73 KB

We 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.