0

I have a a content type with Title, Body, File (private), and Taxonomy. I want all users to be able to see the Title, Body and Taxonomy for marketing purposes, but they should only be able to download the file if they are an authenticated and their account is related to the same taxonomy term(s) the node is related to.

I have private files set up properly and have written a custom module implementing hook_file_download_access to check if the user should have access. If I go directly to the file URL, access is working as I think it should.

My problem is I'd like node page to say:

  • "Register Now" if the user is not logged in
  • "Contact Customer Support" if they are logged in but don't share the proper taxonomies
  • or "Download Now" if all checks out.

Just not sure how to get it done?

0

If your using the Pages Module then you can make different page 'variants' for different roles.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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