When associating a Salesforce File to an object in the UI, the associated ContentDocumentLink and ContentVersion records are not returned when a public guest/site user queries for them. An internal Salesforce user can query for them fine. We've tried updating sharing settings, changing owners, and verified the query runs in apex without sharing set. The only thing that seems to work is if I recreate those objects in apex, then the user can query for them.
Has anyone run into this? Is there a way for the site user to have access without recreating the objects in apex?