I am trying to let a guest user from our Salesforce site create a ContentDelivery record in order to create a public available link for a signature he just posted in the website. I cannot give him the permission to create ContentDelivery records; I tried by creating a custom permission set but the guest license doesn't let me assign it to him. Then I tried with an Apex class without sharing, but I still get this error message :
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, ContentDocumentLinkTrigger:
execution of AfterInsert\n\ncaused by: System.DmlException: Insert
failed. First exception on row 0; first error:
INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access
rights on cross-reference id:
Do you guys have any idea how to bypass this? I either need to somehow create the ContentDelivery record from another user as soon as it is needed, or give this permission to the guest user.