Anonymous JSON:API users can't view Redirect Entities

Created on 10 August 2019, over 5 years ago
Updated 4 August 2022, over 2 years ago

Problem/Motivation

JSON:API consumers cannot retrieve redirects because viewing a redirect entity is based on the permission "administer redirects". Those who wish to bypass Drupal's router, but use functionality/not retrain users are left unable to use this module.

Reproduction

  1. Install JSON:API and Redirects.
  2. Create any redirect.
  3. As an anonymous user, navigate to /jsonapi/redirects/redirects and see that any redirects created require "administer redirects" to view

Proposed resolution

Implement access() and provide a "view redirects" permission that is disabled by default. Add a description to said permission that makes it clear that this is for use with APIs.

Remaining tasks

Patch written, review needed.

User interface changes

Additional Permission now available called "View individual URL redirections through APIs".

API changes

None as far as I'm aware.

Data model changes

None as far as I'm aware.

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States MarieKirya

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024