3

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).

  • if you can log a case with support you might be able to get some traction, just make sure to call it out as a "Regression" and be very clear the same code worked prior to Winter '19. With a bit of luck you might get through to someone knowledgeable who can steer you around whatever issue has come up, and or tell you they intentionally broke your stuff and it's never coming back (hopefully not) – Ralph Callaway Nov 7 '18 at 6:24
  • ps there was also a recent critical update which recent some permission for guest user profiles, you might double check the profile settings still grant access to that document – Ralph Callaway Nov 7 '18 at 6:25
  • Thanks. I have logged a case as well. Will update here if I find out anything. – Pawel Fronczak Nov 7 '18 at 10:41
  • Unfortunately, Support's answer is that Content Delivery records were never meant to be accessed by Guest users (so I guess in the past this was working unintentionally). They have pointed me to the critical update you mentioned: releasenotes.docs.salesforce.com/en-us/winter19/release-notes/… and also this Idea: success.salesforce.com/ideaView?id=08730000000cH2vAAE. "Sigh!" :( I'll leave the question open in case someone will have a good idea on how to deal with this in the post-Winter'19 world – Pawel Fronczak Nov 12 '18 at 8:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.