Closed (fixed)
Project:
File Entity (fieldable files)
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Aug 2013 at 13:38 UTC
Updated:
16 Nov 2014 at 07:48 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dave reidLet's try the following patch. Does this resolve the issue for you?
Comment #3
morenstratNo, it does not resolve the issue because I additionally have to grant the "download any [file type] files" permission. I think the other problem is that file_entity_file_download() returns -1 and thereby does not allow other modules to grant file download access (e.g. the image module which should be able to grant download access of images based on node access).
However, I'm not really familiar with the file_entity code and I don't know if not returning anything will break the file_entity access logic.
Another problem I just encountered is that my EntityFieldQueries also break with this version of file_entity. Nodes with files in private fields are not returned by EntityFieldQueries anymore.
Comment #4
drupalnuts commentedThat seems correct.
https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func...
When it returns -1 it will prevent other hooks from running.
Comment #5
devin carlson commentedA patch to make
file_entity_file_download()return NULL if it doesn't find any reason to approve/deny access.Also, since core's idea of "downloading" a file is the same as File entity's ability to view a file, I think that the "view" op is correct. Talking to some other file/media management folks, it sounds like we could just remove the "download *" permissions in the future.
Comment #6
morenstratI can confirm that returning NULL or not returning anything solved the problem for me.
As for the op, I don't know. I thought that "downloading" a file means to get the file contents and "viewing" a file means to see file's field data...
Comment #7
devin carlson commentedCommitted #5 to File entity 7.x-2.x.
@dunix you're correct about view vs. download but it can get confusing when a user has permission to "view" a file (by going to file/fid/view), lets say an image, but when they go to the page they get a missing image because they don't have "download" access.
I personally prefer unifying view + download but that's for another issue.
Comment #9
silkogelman commentedFYI: I had a similar file permission problem blocking access to private files even when they had the right view permissions.
(private files, file access based on Organic Group membership with og_access and og_field_access.)
upgrading from 7.x-2.0-beta1 to 7.x-2.x-dev (2014-Nov-14) seemed to fix the problem.
Update: Related issue #2351691: Access denied when downloading private files - decide if file_entity_file_download() should deny access by default or not