I have a Site, where external, unauthenticated users can access some of the files we store in Salesforce. To achieve this, I use Content Distribution records, to obtain the public URLs for these files. The Visualforce page displayed in the Site has a controller, which queries related
ContentDistribution records and displays the links. This was working fine up until a few days ago (possibly up until the Winter'19 release).
Currently when external users try to access the files, the controller throws an error:
sObject type 'ContentDistribution' is not supported
As a workaround I moved querying
ContentDistribution to a
without sharing class and use a Custom wrapper class to hold the name and URL of the file, but this doesn't seem like a good solution in the long term.
Is there any new feature or critical update, that I missed, that takes away access to
ContentDistribution from public Site users? And if so, is there any better way to allow unauthenticated users see/download files from a Salesforce org?
I know about the "share via link" option on files - but I haven't found any resources on how to use it programmatically (both to create the public link and to query it).