function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sfdc freshersfdc fresher 

how to control the access of records to just above its hirerachy (not to all users above its role)

how to control the access of records to just above its hirerachy (not to all users above its role)
Ajay K DubediAjay K Dubedi
Hi sfdc,
Role hierarchies are used to restrict the user's visibility for user below the role hierarchy. The topmost in the hierarchy have access to read/write all the records of the users below in the hierarchy. You cannot restrict the particular users using role. 
For this, you can use permission sets and assign the permission sets to that user.

Have a look at the below references:
https://help.salesforce.com/articleView?id=admin_roles.htm&type=5 (https://help.salesforce.com/articleView?id=security_controlling_access_using_hierarchies.htm&type=5)
https://help.salesforce.com/articleView?id=security_controlling_access_using_hierarchies.htm&type=5

Hope it helps! 

Thank you,
Ajay Dubedi