The /download path always returns access denied for all other users but user 1.

The logical thinking then is that there is some kind of permission that I havent set for anonymous users - but I really cannot figure out what it could be

I have obviously set the "media entity download" permission.

I've been digging into the code, and it appers that for all other users than UID1, this line in DownloadController.php returns a header array with a -1 value:

$headers = $this->moduleHandler()->invokeAll('file_download', [$uri]);

I guess this is a sign that the issue must not be with this module - but I was hoping someone would have an idea of why this is happening?

Comments

ras-ben created an issue. See original summary.

Berdir’s picture

Category: Bug report » Support request
Status: Active » Postponed (maintainer needs more info)

Check implementations of that hook, are you using private files? are anonymous users allowed to view entities?

You will have to debug through that hook to figure out who is denying access. The result should be keyed by module, so that should give you an idea.