Skip to main content Join the Agentforce Virtual Hackathon to build innovative solutions and compete for a $50k Grand Prize. Sign up now. Terms apply.
Issue: Community User unable to download an attachment linked to a custom object.

 

Setup

:

  1. Org is a classic org. Community is on Lightning. Hence we still use Attachments & not Content Libraries.
  2. Community user has read access on Object A which is on the master side of Master Detail Relationship with Object B. 
  3. So sharing to object B is controlled by the parent, A.
  4. 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>

  5. When the community user clicks the link, a "Insufficient Access" message is shown.
  6. 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
  1. Aug 1, 2020, 7:28 AM
    Hi Gautam, 

     

    Community users have Object read access and the attachment not getting download, Whereas Admin can download from the community. 

     

    So the problem is not related to the community setting It is related to user access, And access you have given read So if you give read-write access then you are able to download the attachment can you try this?

     

    If so need to have workaround when user click on link share record with write access and once download remove the access by using coding.

     

     

     

    Also before this workaround have link like as below in aura cmp 

     

    <a href="{!URLFOR($Action.Attachment.Download, '00P0p000000hzjNEAQ')}">Download</a>
Loading
0/9000