log warnings for JSONAPI resources omitted due to insufficient authorization

Created on 28 April 2025, 4 days ago

Problem/Motivation

When the Entity Reference processor fetches entities, some can fail authorization. In this case, it would be useful if this was logged as warnings.

Steps to reproduce

Proposed resolution

Process the authorisation failures in the JSONAPI. These are of the form:

    "meta": {
        "omitted": {
            "detail": "Some resources have been omitted because of insufficient authorization.",
            "links": {
                "help": {
                    "href": "https:\/\/www.drupal.org\/docs\/8\/modules\/json-api\/filtering#filters-access-control"
                },
                "item--h1tlUJh": {
                    "href": "https:\/\/EXAMPLE.COM\/jsonapi\/paragraphs_library_item\/paragraphs_library_item\/a73c8f1c-5cc0-4eda-9d75-3ee6a64bf468",
                    "meta": {
                        "rel": "item",
                        "detail": "The current user is not allowed to GET the selected resource."
                    }
                },
SNIP

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

4.0

Component

Code

Created by

🇬🇧United Kingdom joachim

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024