I have a few documents uploaded to salesforce files and i have a force.com site with the public guest user profile. When i enter my force.com domain my visualforce page queries for ContentDocumentLinks, however when the guest user queries them only one of the three files shows up. The content document link have the same permissions, the content documents as well. I there any permission in any related object that i am missing?
I believe I found a workaround for this issue. Creating a before insert trigger on ContentVersion that sets the Origin field to C, along with a before insert trigger on ContentDocumentLink that sets Visibility to AllUsers, allowed the public force.com site guest user to access the Salesforce File which was uploaded by the out of the box UI. So records started being returned when querying ContentDocumentLink and ContentVersion as the site user after uploading with those trigger changes in place.