Sometimes you need to restrict access within Salesforce for certain users or roles. Unfortunately if you are using the default sharing settings, this is not possible as sharing roles can only grant access, not restrict.
The best solution is to do the following:
- Create a public group that includes all roles except for the one(s) with restricted access.
New Public Group:
- Create sharing rules that mirror the existing Organization Wide Defaults:
The first rule gives Everyone (Excluding Consultants) the Read/Write access to the Sales Consultantsâ€™ accounts and opportunities. The Management and Administrative roles will have read/write/transfer access through role hierarchy.
The second rule recreates the existing org wide default sharing rules, but only for the Everyone (Excluding Consultants) group.
- Change the org wide defaults for account and opportunity to private (make sure to do this step last).
- Repeat for other objects as needed (process may vary slightly). If you understand role hierarchy this should be pretty straightforward.
When you add new roles to your organization, make sure to add them to your public group, or they will only be able to view their own accounts!