We have a custom role, location_editor, which is assigned to users who can only manage media and one content type.

These are the role's media permissions.


And if the user now tries to enter any valid media edit url (for example /media/35/edit - which does exist and was created by him), the result is a 404. The admin user can edit it just fine. The user can also access /media/35/delete without problems.

I tried to debug the stack already, and for example the MediaAccessHandler is correctly called and returns a accessAllowed().

Is there any right I might miss in the configuration?

Is there a good way to debug this, to find the reason why Drupal considers this a 404 error for this specific role?

1 Answer 1


My colleague managed to find the solution by great intuition (aka "pure luck"). It turned out, that our additional module Rabit Hole is causing side effects here:

enter image description here

Enabling "Bypass Rabbit Hole for Media" for the location_editor role solved the issue.

His debugging skills are noteworthy thou:

  1. he checked issues on drupal.org and as there was nothing about 404 on edit he assumed that it must be something on our side
  2. the code was actually clean
  3. it must be something funny, probably a side effect of a contrib module
  4. he checked the composer.json for unusual modules that might have something to do with access check -> bingo :)

Many thx!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.