I have files attached as ContentDocument and I want to be able to retrieve it in a Community (Napili template) which has public access. My SOQL is not returning any row but a login user on Lightning experience is being able to get the Content Document.

Is there anything I can do to retrieve the Content Documen? Or any alternative solution?

  • does your content relate to an SObject and if so does the community user have access to that record? Feb 14, 2017 at 9:59
  • Yes, it does relate to an SObject (Contact more precisely), I can view the contact detail under community, but it seems I can't retrieve ContentDocument but can do so with Attachment.
    – Kevan
    Feb 14, 2017 at 16:41

1 Answer 1


Check whether you have necessary permissions to access the ContentDocument. Use can find it with SOQL query, try the below query and see whether you have permissions

SELECT Id, Name, UserRecordAccess.HasReadAccess, UserRecordAccess.HasTransferAccess, UserRecordAccess.MaxAccessLevel FROM Object

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .