Closed (fixed)
Project:
Web File Manager
Version:
6.x-2.10-rc2
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
31 Oct 2008 at 18:20 UTC
Updated:
18 Jul 2010 at 21:52 UTC
Hello,
I am using WebFM to limit file downloads to certain roles. It seems that the only way to do this is within WebFM. Is it not possible to link to the file?
For example, if I have user type "Privileged Member", and user type "Privileged Member" can download any file, can I make a link to a secured file (within WebFM) from another node? This way ALL users can see the link, but only those who are logged into "Privileged Member" can download it.
So you can go to example.com/node/20 and see the download link for FileX.pdf, but only those logged into "Privileged Member" can download FileX.pdf. "Privileged Member" would not have to go through WebFM to download FileX.pdf.
Thanks a lot,
-ROR
Comments
Comment #1
Frank Steiner commentedI think you can do that as far as I remember the access check code. A file is downloadable for non-logged-in users only if it has the "public download" file permission (in the context menu for a file in the file browser). If you remove that, logged-in users can only download the file (e.g. via your link) if the file has either "Role view/download" permission set and the user has a same role as the file owned, or if the file is attached to a node that the user can view.
Thus, remove the public download, set the "Role view/download" and make sure the folks who should download the file share a role with the file owner.
Comment #2
Hallelujah H commentedThere is a useful document attachment here which may help (you need to register for access to the file)
http://11heavens.com/files-in-Drupal
Comment #3
nhck commented