Search code examples
salesforcehierarchyrolessharingadministration

Restrict record level access to mutual between a manager and their subordinates, if there are multiple managers in salesforce


By default, Record Level Sharing bubble up to all the user who is above in the hierarchy chain.

Let's imagine we have a simple hierarchy: lead (10 users) -> developer (40 users)

If each lead has 4 developers as their subordinates. How can we restrict access of the developer record to share only to their lead and not with other leads who all are having the same role?


Solution

  • Able to achieve the same by using manager groups feature in sharing settings:

    Steps to follow:

    1. enable manager groups in sharing settings
    2. remove grant hierarchy access for that particular object
    3. Setup complete org users hierarchy from user records.
    4. create a sharing rule to share the access of a particular role to their manager of the manager group.

    Reference Links:

    https://help.salesforce.com/articleView?id=users_managers_only.htm&type=5

    https://focusonforce.com/configuration/salesforce-manager-group-sharing/