1

I have ContentVersion record with custom field Status__c. I have apex code updating Status__c field. It is working correctly if I use user with Salesforce license.

The updating user is not owner of ContentVersion record.

I changed license of user to Salesforce Platform and I got error "INSUFFICIENT_ACCESS_OR_READONLY, You do not have the level of access necessary to perform the operation you requested."

I understand that I need grant update permission to user who is not owner and trying to update.

Question1 : Is it possible to make it working by user with Salesforce Platform license or there is no chance to be able to update Status__c field by user with this license?

Question2: If user with Salesforce Platform license can update ContentVersion.Status__c (custom field) field in terms of license, what permissions shall I set?

Thanks

2
  • 1
    This sounds like a sharing issue. Is your Apex class with or without sharing?
    – Phil W
    May 6, 2023 at 7:09
  • You should post your issues as part of the question then self-answer.
    – Phil W
    May 8, 2023 at 7:39

1 Answer 1

1

SOLUTION I found: I needed to fix 2 points. My code flow is ContentVersion--> ContentDoc --> ContentDocumentTriggerHandler --> update of XYZ__c. I did not have Edit permission for XYZ__c object for user with Salesforce Platform license + I needed to set ContentDocumentLink.ShareType=I for ContentDocumentLink record with LinkedEntityId related to XYZ__c. This way I am able to share ContentDocument based on ShareType set on ContentDocumentLink record. My XYZ__c has Edit permission and I can now edit ContentVersion custom field because ContentDocumentLink has set ShareType=I.

You must log in to answer this question.

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