Why record-level sharing matters
"We have five regional sales managers. Each one should only see deals in their own region β but our VP of Sales needs full visibility across every region, every rep, all the time."
Object-level permission ("can this user read Opportunities at all?") isn't enough here β the real requirement is row-level: which specific Opportunities can this user see?
Anatomy of the sharing model
Three layers combine to decide exactly which records a given user can see:
| Layer | What it sets |
|---|---|
| Organization-Wide Default (OWD) | The baseline for an object: PRIVATE, PUBLIC_READ, or PUBLIC_READ_WRITE |
| Role Hierarchy | When enabled on an object, a manager automatically sees every record owned by their direct reports, recursively |
| Sharing Rules | Explicit, criteria-based or manual grants that expand access beyond OWD for specific users or groups |
| OWD Level | Who can read | Who can edit |
|---|---|---|
| Private | Owner only | Owner only |
| Public Read | All org users | Owner only |
| Public Read/Write | All org users | All org users |
This same visibility resolution β SharingService.resolveVisibleOwners() β is reused everywhere: record lists, record detail pages, and Reports. Configure it once, and it's enforced consistently across the entire platform.
Set up regional visibility on Opportunity
region__c = "West", shared with: West Region Manager, access: Read/Write.Test what you learned
resolveVisibleOwners() returning null mean?