With Drupal 7, I created a content type with a field to attach files. I am using private file uploads. When viewing the node, the list of attached files is visible to every user, including anonymous users.
I want that logged-in users are able to click on a file link to download the files attached to nodes; anonymous users should be able to see the list of files, but clicking on a file link should show them the login page, forcing them to log in, and them download the attached files.
How can I achieve this?