Reputation: 179
the modules Group 2, Jsonapi , Media and Groupmedia are used in a Drupal 10 installation. Group media (image) should be read out with Jsonapi.
Example of the Jsonapi call for a single image in a group.
If the admin is logged into the web browser, the Jsonapi call returns the image data correctly. If the call is made in an anonymous window, a 403 error is returned. "errors": [ { "title": "Forbidden", "status": "403", "detail": "The current user is not allowed to view this relationship.",
The permissions to view media in the groups are set for Guest/Anonymous.
I have seen that the permissions are checked in the class "EntityAccessChecker" of Jsonapi, namely in the function
public function getAccessCheckedResourceObject(EntityInterface $entity, AccountInterface $account = NULL)
My thought was whether I can override this EntityAccessCheck with a custom module for specific routes or entity types. Does anyone have an idea?
Thanks, rhodes
Upvotes: 0
Views: 26