I would like to understand how role hierarchy works in SF as I have tried a few settings but somehow the role hierarchy is not respecting the record level access although the record level access is set to private.
A question related to how users are setup in SF, that am hoping one of you guys can help point in the right direction (need this in the context of a requirement I am building out)….
How do I meet the following requirement on any SF org? (a) I have user-1, user-2, Principal-1 & Principal-2 (b) User-1 reports to Principal-1 & User-2 reports into Principal-2 (c) So if User-1 creates a record, we want Principal-1 to automatically get access to that record. But Principal-2 should not have access to that record in theory how role hierarchy in private mode should work. Courtesy: Controlling Access Using Hierarchies (salesforce.com)
What I have tried and it did not work is below.
I created these 4 users in SF (Setup Users). When doing this: a. I did not specify any value for the “Role” field on the User record b. I did specify the “Manager” value on the User record – setting Principal-1 as User-1’s manager, and Principal-2 as User-2’s manager c. RESULT: As User-1, I created a record. As Principal-1, I am not able to access this new record d. Based on the SF doc, it did indicate that the User’s Manager by itself does not have any impact on data visibility/access.
To overcome this limitation, I crated a role hierarchy – created a role “Role_USR” whose parent role in role hierarchy is “Role_PRIN”. I updated User-1/2’s user records to have their role as Role_USR, and the Principal-1/2’s user records now have their role as Role_PRIN
a. RESULT: As Principal-1, I am able to access the record created by User-1.
However, now Principal-2 user is also able to access this record.
What do we need to do here in the above use case where Principal-2 user is restricted to access the record created by user-1, who reports to principal-1.