0

We have a custom object set as Public Read/Write, Grant access using hierarchies checked.

I have a user outside of the Role Hierarchy and who does not have Modify All Data on this object.

How can i grant this user Delete permissions for some records, considering Custom__Share is not available as the OWD is Public?

3

Delete access cannot be provided by sharing rules hence Custom__share object does not come into picture for your scenario.

In such a case, only those users can delete a record who

  1. Is the record owner.
  2. Is higher than the owner in the owner's role hierarchy
  3. Has the 'Modify All' permission

Other than these scenarios, user will get insufficient privileges error. You can refer Salesforce Help for further information.

In such scenarios, you can

  1. Build a custom button which calls apex which runs in system context. This will allow deletion of record as it will run in system context.
  2. Change the ownership of the record from trigger to a Queue which includes that user OR to the user who wants to delete the record.
  3. Provide Modify All permission to that user using a permission set.

Note : To provide Delete access to records which are not owned by user, you do not need to have Modify All Data, user with Modify All permission can delete those records

  • Modify All Data: Create, edit, and delete all organization data, regardless of sharing settings.
  • Modify All: Give Read, Add, Delete permission to selected Object, Create permission is not included in Modify All permission.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.