1

I tried to follow the Answer from this Question:

Is is possible to grant delete permissions using apex managed sharing?

I have an Apex Managed Sharing with 'edit' for the public group the user is in and the user can edit the record. The user has a permission set that gives them CRUD for the custom object but I get an "Insufficient Privileges" error when I try to delete the record I'm able to edit logged in as that user.

From what I'm reading in this answer I should be able to delete the record since I have 'Edit' on the record and Delete on the object. Did something with this change since this answer was posted?

(I couldn't comment on the original question/answer)

2

The statement from the docs at the end of your linked question is key here:

This access level can only be granted with Force.com managed sharing.

in reference to the "full control" sharing setting.

Force.com managed sharing is the term for sharing that is granted by the platform itself - so record owner and manager of record owner if you simplify the statement.

Per the docs linked there you need "Full Access" to be allowed to delete.

Pair these two facts together and it turns out that nope - there's no way to grant delete access via apex sharing rules. The only options are to use force.com managed sharing (i.e. change the owner, or be above the owner in the role hierarchy), or grant modify all on the profile/perm set.

The other option would be to make a custom VF page or action that allows deleting the record via without sharing apex if the user has edit rights, but that doesn't allow the normal delete DML event, so has some drawbacks.

2
  • Thanks @ca_peterson! The answer on the other question seems misleading, should we do something about that? – HungryPipo Jul 11 '17 at 21:41
  • You're welcome to draw from/link to my answer and post one of your own there – ca_peterson Jul 11 '17 at 22:26

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.