Setup
:
- Org is a classic org. Community is on Lightning. Hence we still use Attachments & not Content Libraries.
- Community user has read access on Object A which is on the master side of Master Detail Relationship with Object B.
- So sharing to object B is controlled by the parent, A.
- I have created a ligtning component to allow Community Users to download a specific document upload in Notes & Attachments of Object B
<a href="{!'/communityname/servlet/servlet.FileDownload?file=00P0p000000hzjNEAQ'}" target="_blank">Download</a>
- When the community user clicks the link, a "Insufficient Access" message is shown.
- The community user has Read access to object A via a sharing set and hence is able to see records related to object A in the community.
My assumption was since object B's access is controlled via parent (A), community user should be able to see the attachment of B automatically. However that is not the case. I have even tried giving Edit access (as sugested by a few community users) on Object A to see if that works but its doesn't.
What else am I missing here and how can the community user access the attachment. The link works for an admin.
Regards,
Gautam.
5 answers
Hi Gautam, I am afraid, I cannot change the data model. The attachments are created in Salesforce by a 3rd party system. And also, in my case, a community user will never own a record. A record created by a staff (having access to Salesforce) is being shared with the community user based on a few conditions. The only purpose (as of now) of the community user is to see those records and download a specific file. Yes gautam correct you cannot change the OWD then create custom object to store notes and attachments as suggested in the above explanation also. Hey Shivam, Hi Gautam,