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?