I have the following use case:
A web shop (Java) retrieving products from SF using the SOAP API. Attached "Files" are retrieved and displayed by selecting them through ContentDocumentLinks related to the Product2 object.
SELECT Id, Name, ProductCode, Description, IsActive, (SELECT ContentDocument.LatestPublishedVersionId FROM Product2.ContentDocumentLinks), (SELECT UnitPrice FROM Product2.PriceBookEntries LIMIT 1) FROM Product2 WHERE IsActive = true
This works, but not all files should be accessible in the web shop. I want to differentiate 3 types of files:
Members only and
Public. Our users are not "Salesforce" users (we retrieve data using one API user), so don't think sharing rules or groups can be used...
Best would be if I could change my subquery to:
(SELECT ContentDocument.LatestPublishedVersionId FROM Product2.ContentDocumentLinks WHERE Type__c = 'Public') but I can't add fields to the ContentDocumentLink...