Grant query level access to own unpublished nodes

Created on 4 June 2024, 3 months ago
Updated 17 July 2024, about 2 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') method is called on an already loaded Node object by node id or via loadMultiple().
However, when Node ids are collected vua 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 less than a minute 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