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

Frank Steiner’s picture

I 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.

Hallelujah H’s picture

There is a useful document attachment here which may help (you need to register for access to the file)

http://11heavens.com/files-in-Drupal

nhck’s picture

Status: Active » Closed (fixed)