Update: There isn't currently an object exposed with the ContentWorkspace Member details as configured against the Library.
Screenshot of the Members section from the UI:
I believe a SOQL query against ContentWorkspace will only return records that the current user has access to. However, this won't indicate the level of access.
Consider promoting the idea: workspace permissions
I would start with ContentWorkspaceDoc.IsOwner.
Description
Read only. Indicates whether the library owns the document and
determines permissions for that document (true) or not (false).
Documents can belong to more than one library, but only one library
owns the document and determines its permissions.
The Data Model diagrams can be useful here.
In your case I would make a wrapper class that holds the info you want. Store the wrapper in the map, and then reference the wrapper.
public map<String, List<WrapperClass>> mapFYToList {get;private set;}
public SDGProgrammeController()
{
mapFYToList = new map<String, List<WrapperClass>>();
for(Site__c r : [SELECT StoreNo__c, Probability__c, Name, JS_Region__c,JS_Zone__c, Address__c, Postcode__c,
(SELECT MeetingDate__c,RecordType.name,Total_Sales_Area_Uplift__c, TU_Sales_Area_Uplift__c, TUSalesAreaPre__c,
TUSalesAreaPost__c, SalesAreaPreExcCO__c, SalesAreaPostExcCO__c, NonFoodSalesAreaUplift__c, NonFoodSalesAreaPre__c,
NonFoodSalesAreaPost__c, GMSalesAreaUplift__c, GMSalesAreaPre__c, GMSalesAreaPost__c, FoodSalesAreaUplift__c,
FoodSalesAreaPre__c, FoodSalesAreaPost__c
FROM Financial__r
WHERE MeetingDate__c != null AND Recordtype.Name IN('CCM','CCM Update','IB')
ORDER BY MeetingDate__c desc
LIMIT 1),
(SELECT Launch_date__c,Start_On_Site__c, Status__c,Store__c,ProjectName__c,Investment_Type__c,ProjectManager__c,
MainContractor__c,RetailHandover__c,Closure__c,Launch_FY__c,Launch_Period__c, Launch_Quarter__c
FROM Investment_Programs__r
WHERE Status__c IN('Live','Feasibility','Completed') AND RecordType.Name ='New Store' )
FROM Site__c
WHERE Recordtype.name = 'Supermarket' AND Probability__c IN('Open','Certain','Possible','Probable')
AND Id IN(SELECT Site__c FROM Financial__c WHERE MeetingDate__c != null AND Recordtype.Name IN('CCM','CCM Update','IB'))
AND Id IN(SELECT Site__c FROM InvestmentProgram__c WHERE Status__c IN('Live','Feasibility','Completed') AND RecordType.Name ='New Store')
ORDER BY Launch_Date__c asc LIMIT 999])
{
if(mapFYToList.get(r.Investment_Programs__r[0].Launch_FY__c) == null)
{
mapFyToList.put(r.Investment_Programs__r[0].Launch_FY__c, new List<WrapperClass>{new WrapperClass(r)};
}
else
{
mapFyToList.get(r.Investment_Programs__r[0].Launch_FY__c).add(new WrapperClass(r));
}
system.debug(mapFyToList);
}
}
public List<String> getKeys()
{
List<String> keys = new List<String>();
keys.AddAll(mapFYToList.KeySet());
keys.sort();
return keys;
}
public class WrapperClass
{
String name {get; set;}
String postCode {get; set;}
Stirng status {get; set;}
Integer probability {get; set;}
public WrapperClass(Site__c site)
{
name = site.Name;
postCode = site.Postcode__c;
status = site.Investment_Programs__r[0].Status__c;
probability = site.Probability__c;
}
}
}
And then in your VF Page
<apex:repeat value="{!keys}" var="fy">
<apex:pageBlockTable value="{!mapFYToList[fy]}" var="obj">
<apex:column value="{!obj.name}"/>
<apex:column value="{!obj.postCode}"/>
<apex:column value="{!obj.status}"/>
<apex:column value="{!obj.probability}"/>
</apex:pageBLockTable>
</apex:repeat>
Best Answer
Let's say you upload a file under any record or chatter, the file reference is retrieved from
ContentDocument
object.ContentDocument
represents the library in Salesforce CRM Content or Salesforce Files.Based on the ContentDocumentId, you can retrieve the ShareType and LinkedEntityId from
ContentDocumentLink
object.Here
LinkedEntityId
will return list of users.ShareType
LinkedEntityId
Visibility
For more information, refer ContentDocumentLink
Update based on comments
In the debug log, I get userids.