Closed (fixed)
Project:
File Entity (fieldable files)
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
20 Nov 2012 at 16:07 UTC
Updated:
21 Mar 2013 at 06:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
milanchheda commentedNot sure, if I got it correct but you can probably use public files instead of private. Public files will enable access to all files to everyone. To restrict it to just the authenticated users, you can capture the file callback and override it.
For e.g. if your files are stored in sites/all/files, than override it's callback whereby you can simply check if the user is logged in or not, using user_is_logged_in()
Comment #2
enochRoot commentedThanks for the answer.
What exactly do you mean by 'its callback' ?
Also public files can be seen/downloaded by anybody, just by http request - no Drupal callbacks involved...
eR
Comment #3
dazz commentedI had a similar case, fix it by using hook_file_entity_access
Comment #4
enochRoot commentedThx,
I'll try somthing like that.
Comment #5
devin carlson commentedA patch to add a new permission "view any private files".
Comment #6
devin carlson commentedUpdated patch with more consistent permission name.
Comment #7
devin carlson commentedCommitted to 7.x-2.x.
Comment #8
enochRoot commentedWell, the new permission shows up as an option, but I still need the 'Administer files' permission for the media browser to show any private file. Is that intended?
thx,
eR
Comment #9
devin carlson commented@enochRoot not sure, it sounds like it might be an issue with the Media module.
Comment #10
ParisLiakos commentedwe should add
restrict access => TRUEhereComment #11
ParisLiakos commentedhttp://drupalcode.org/project/file_entity.git/commit/d3a647f