Permission for private file to anonymous 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


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.