Sub topic 15
Designing a Sharing Model: Start Restrictive, Keep the Hierarchy Simple
This chapter assumes you know org-wide defaults (OWD), roles, the role hierarchy, and the ways to open access: sharing rules, teams and manual sharing. It shows how to combine them into a model you can explain and maintain.
Start with the most restrictive default
Set each object's OWD to the most restrictive level that any user needs. Then open access for the people who need more. You can open access with sharing rules, teams and manual sharing, but you cannot use them to restrict access below the OWD. If you start too open, you can't tighten access later without removing access people already rely on.
Ask these questions for each object, in order:
- Does anyone in the org need to be blocked from seeing a record they don't own? If not, Public Read Only may be enough.
- Does everyone need to edit every record? Use Public Read/Write only if yes.
- Is the object a detail in a master-detail relationship? Then access comes from the parent, and you don't choose an OWD for it.
Keep the hierarchy simple
The role hierarchy exists to pass record access upward. It is not an org chart. Build it around who needs to see whose records.
- Keep it shallow. Each level adds sharing calculation work, and deep trees are harder to reason about.
- Create a role only when it changes who sees what. Two teams with the same visibility can share one role.
- Don't mirror every job title. Titles belong in a user field, not in roles.
- Use permission sets and profiles for what users can do. Use roles only for which records they can see.
In this model, a West Sales Rep's private records are visible to the West Manager and the VP, but not to East roles.
Open access only where needed
When the hierarchy does not reach the people who need a record, add the narrowest tool that works.
| Need | Tool |
|---|---|
| A whole group needs access based on criteria or ownership | Sharing rule |
| A few people work together on one account or opportunity | Account, opportunity or case team |
| A one-off request for one record | Manual sharing |
| Access that must be computed by custom logic | Apex managed sharing |
Prefer sharing rules over manual sharing. Rules are visible in Setup and stay consistent as records change. Manual shares are lost if the record owner changes.
Check the result
After you design the model, test it with real users. Run this query to confirm what a specific user can do with a specific record:
SELECT RecordId, HasReadAccess, HasEditAccess, HasDeleteAccess
FROM UserRecordAccess
WHERE UserId = '005XXXXXXXXXXXXXXX'
AND RecordId = '001XXXXXXXXXXXXXXX'Test one user from each role and one user outside the hierarchy.
Common mistakes
- Setting Public Read/Write "to avoid support calls." This removes the protection that sharing provides.
- Adding roles to fix a one-off access need. Use a sharing rule or manual share instead.
- Turning off Grant Access Using Hierarchies on a standard object. This is not allowed. You can turn it off for custom objects, and you should do so only with a clear reason.
Exercise
A company sets Opportunity OWD to Private. Sales reps in the same region need to see each other's opportunities, but the hierarchy puts each rep under the same manager only. What is the simplest change, and why not make the OWD Public Read Only?
Show answer
Add a sharing rule that shares opportunities owned by members of the regional role (or public group) with that same group, with Read Only access. Changing the OWD to Public Read Only would expose opportunities to every user in the org, including other regions, and it is harder to undo than adding a rule.