1

I'm trying to create a Drupal 7 feature whereby an admin uploads multiple files that are only visible/downloadable by a specific user. These files would be visible on the user's profile page or (alternative) a document page where a user would only see the files available to them. Ideas?

2 Answers 2

1

Drupal private files can only be downloaded by someone who has access to the node the file is attached to.

So you can set up a content type that allow an unlimited number of files attached to a node. Then you set up an Access Control List to that node, where you make sure only the specific user has access to the node. Let the admin create one node per user, and upload all files to be shared privatly with a specific user to the user's node.

To mange access control lists to nodes, you can use Flexi Access module.

1
  • That sounds dead easy - I'll give it a try after field permissions (only because it's easier to have the downloads appear on a profile page). Commented Apr 7, 2015 at 12:09
0

Another option, simple as it doesn't require extra nodes:

  • Install the Field Permissions module
  • Add a File field to the user (admin/config/people/accounts/fields)
  • When editing the field you have just added, you should see the config options for Field Permissions in a section titled "Field visibility and permissions". Choose appropriate permissions. You can let the user view their own value, but only admins edit. Or you can let the user edit their own files too.
1
  • Ah - so it would be adding a field to a profile and letting only users & admins see it? That sounds ideal, I'll give it a shot. Commented Apr 7, 2015 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.