I have created a Customer Community. In there is a section where they can update their "skills", which behind the scenes is a Contact_Skill__c
custom object holding that data.
I'm running into an issue where the Community user doesn't have permissions to delete the records in that object. I have checked/completed the following:
Contact_Skill__c
has public read/write sharing settings.- Verified Community Sharing Set (may not be needed, but not available since public read/write).
- Granted Read/Updated/Delete access to the Community user's profile for that object.
However, despite taking these steps, I'm still unable to delete these records using Apex. In my Apex code, I even check if the user has write and delete access before attempting to delete and according to the checks (DescribeSObjectResult
) the user has that access.
The only thing I can thing I can think of is that Customer Community license doesn't allow deleting custom records. Is my assumption correct (hopefully not) or should I be able to delete custom object records as a Customer Community license user?
If I can delete custom object records, what else should I check to make sure my Community user has access to the delete the object?
Here's the error message (ID omitted, but points to the record I'm trying to delete):
System.DmlException: Delete failed. First exception on row 0 with id {omitted}; first error: INSUFFICIENT_ACCESS_OR_READONLY, insufficient access rights on object id: []
Here's the CRUD settings for the Customer Community profile:
Here's the Sharing Setting for the Contact Skill
custom object:
I also tried setting the Sharing settings to Public Read only, then creating a Community Sharing set, but still could not delete:
I'm attempting to delete the Contact_Skill__c
records using APEX:
// get current contact skills
List<Contact_Skill__c> contactSkills = [select Id from Contact_Skill__c where Contact__c = :contactId];
// remove them
delete contactSkills;
Here's the controller signature:
public with sharing class InspectorCommunitiesController
This problem may be related to this problem.