I have an ad content type, with a file field that is in a private directory when saving the node.

Ads and their files are only accesible for authenticated users.

I wish I could allow anonymous users to see ads and their files that are promoted.

I use content_access module enter image description here

I want programmaticly, change acces control foreach ads who is promoted and I don't how to achieve that.


It sounds like you might want to check out the Private Files Download Permission module which may provide exactly the functionality you're looking for.

  • Thank you, I already tried the module and the problem is that the files of the directory are accesible by url directly.
    – Kipmag
    Feb 21 '19 at 13:45

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.