Hello,
I am currently developping a website which should allow the visitor to download .zip files after entering a password. There shall be different passwords ; each one specific to a category (ie "flowers-passw" for "flowers" category, "animals-passw" for "animals" category, "objects-passw" for "objects" category, etc). The administrator should be able to modify these passwords easily (I mean not node by node !).
My first idea was to use Taxonomy Access Control Lite . For example : the administrator creates a user named "animals-user". This user has access to nodes with the category term "animals" when logged in with his password "animals-passw". The administrator can give this username and password to anyone willing to access "animals" nodes and he just have to modify the password in "user management" if needed. The problem is : how to apply this restricted access only to a single field ("download file" link) inside a node and let anonymous visitors view the rest of the node ? Should I use Fieldgroup ?
Could there be a much simplier solution to password-protect downloads I didn't think of ? A module I didn't find ?
Thank you by advance for your kind help,
Best regards.
Comments
Comment #1
Dave Cohen commentedIf there's a module out there to do this, I don't know of it. Doesn't sound like a fix for tac_lite, which concerns itself with access to nodes, not files.
Comment #2
simohell commentedTo use Taxonomy Access Control Lite for one website I have, it seems to be sufficent to set:
Site Configuration -> Filesystem -> Dowload method -> Private - files are transferred by Drupal.
(Choose the Public download method unless you wish to enforce fine-grained access controls over file downloads. Changing the download method will modify all download paths and may cause unexpected problems on an existing site.)
I myself didn't see problems so far with changing the method on a live site, but I didn't test everything.
The are other modules that are maybe easier, but I only used some for Drupal 5.
Comment #3
LetUsBePrecise commentedI may not know the answer for the above but changing public to private download method on existing site - may create lots of problems like corrupting downloaded files, performance issue etc.
What #2 says is correct in handling the scenario for new site. I would suggest looking into private-download module which has combination of public and private download files. As such, for fine-grained access control, you need to have some custom code written in hook_file_download. Same thing can be achieved here too with private-download module.
I had same issue for my current running site. Switching to private download method from public caused few issues. I had to rolled back the changes. Then, tried incorporating combination of public/private download method and later figured out, private-download module does the same thing.
HTH
Comment #4
damienmckennaThank you for your contribution to this module. Support for Drupal 6 ended a decade ago, so I'm closing out this issue.
FYI this should be possible using Field Permissions on current Drupal releases.