Grant query level access to own unpublished nodes

Created on 4 June 2024, 7 months ago

Problem/Motivation

Currently "view own unpublished content" access is only checked and grants access a user to its own content when `->access('view')` is called on an already loaded node object by node id or via loadMultiple().
However, when node ids are collected by an entity query or database query with node_access tag in place, unpublished contents by the current user are not returned.

E.g.:

    $result = \Drupal::entityQuery('node')
      ->accessCheck(TRUE)
      ->execute();

This leads to interesting and long term problematic workarounds both in Core and in contrib space:

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Feature request
Status

Active

Version

11.0 🔥

Component
Node system 

Last updated 4 days ago

No maintainer
Created by

🇭🇺Hungary mxr576 Hungary

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024