+ Start a Discussion
Vance Kessler 23Vance Kessler 23 

How to query ContentDocumentLink from Communities?

I have a lightning component that shows a contact's files and attachments. It works fine in my normal sandbox but when I drop it into a Communities page, it shows nothing. I see references to giving users the "View Content in Portal" permission to allow access in Portal ALL OVER THE PLACE, but I have some questions about that:

1. I cannot find the "View Content in Portal" permission anywhere. WHERE IS IT?
2. Are Communities and Portal the same thing or at least do they use the same permission settings?
3. If I find this elusive setting and turn it on, will it allow me to query the ContentDocumentLink, Document, and Attachment objects for a Community user?
4. If I want to allow them to upload their own documents, what are the licensing implications?


Thanks,
Vance
Joshua Long 17Joshua Long 17
Hey Vance,  Did you ever get a resolution to this? I am runnign into a similar issue...
Vance Kessler 23Vance Kessler 23
Sorry, never solved this. We ended up going with a third-party document storage system.
Joshua Long 17Joshua Long 17
Thanks,

I just found that by using the below trigger logic we were able to expose the files in our use case.
 
if(trigger.isBefore && trigger.isInsert){
		for (ContentDocumentLink so : Trigger.new) {
		    so.ShareType = 'I';
		    so.Visibility = 'AllUsers';
		}
	}