Fix (Forbidden) Failed to load resource: when a user role has permission to use media, but only edit own media created ones

Created on 31 August 2024, 4 months ago
Updated 4 September 2024, 4 months ago

First of all, Thanks for working on this nice UI/UX module.
Starting to use it in our projects.

Problem/Motivation

Facing an issue when a user has permission to use media, and only edit own media created ones.
not edit any media.

If the used media was created by another user, the edit media inline button will show up

But when the user click on it, It will have an AJAX error with "Failed to load resource: the server responded with a status of 403 (Forbidden)" .

No UI/UX response

The custom access API, and the output in the console will be Uncaught (in promise) SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON

Proposed resolution

  • OPTION #1 My fix for this is to show the button, but when clicking on it a message shows up and say, you are not allowed to edit this media
  • OPTION #2 Or the button show not show at all.

I’m with option number 1

Remaining tasks

  • File an issue
  • MR
  • Test
  • Review

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A
πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡―πŸ‡΄Jordan Rajab Natshah Jordan

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