1

How do you address the issue where two users within the same role need to be able to delete each other’s opportunities?

In most cases, this can be done by having a super user above the others in the role heiarchy, and this “super user” can delete opp where the owner is below the owner. In my case, I have two of these super users. How do I implement a solution for this lateral access? It looks like manual sharing might work, but that would be messy to implement.

https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_bulk_sharing_understanding.htm

1

You could override the delete button then:

Implement the logic in the class for the button to delete the record if the role of user is the same as the role of the owner.....

0

There are six ways to enable Delete privileges on a record:

  1. The object is a Light Application Object (no Bulk API, Sharing, or Streaming API).
  2. The Owner of a record or their manager (or their manager's manager, etc), or someone above them in the Role hierarchy.
  3. The user has ModifyAll on that object type
  4. The object is an Account or detail of an Account that is in a Territory associated with the user.
  5. If the record's owner is a Queue, any user in that Queue has Delete permissions on that record.
  6. Run Apex without sharing or with some special logic there.

I don't believe that #1 is doable for Opportunities. I don't recommend #3. I don't think #4 works for Opportunities. You are trying to solve the limitation of #2. That leaves #5 or #6.

In general, I'd choose #5 - queues are pretty good because they still respect sharing, but broaden it. However, it means that either users or the system need to properly assign records to those queues.

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.