Sub topic 7
Permissions grant object access; sharing grants record access
This chapter assumes you know what a profile and a permission set are, and that you have met org-wide defaults (OWD) and roles. It explains why a user can hold the right object permission and still not see a record.
Two separate checks
Salesforce answers "can this user see this record?" with two checks, and both must pass.
- Object access. Does the user's profile or any assigned permission set grant Read on the object? This is the "can they use this kind of record at all" check.
- Record access. Does sharing let the user see this particular record? This is the "which rows" check.
Field-level security applies on top of both. It decides which fields of a visible record the user can see or edit.
What each side controls
| Question | Controlled by | Where you configure it |
|---|---|---|
| Can the user read, create, edit, or delete this object? | Object permissions | Profile, permission set |
| Which fields can the user see or edit? | Field-level security | Profile, permission set |
| Which records can the user see? | Sharing | OWD, role hierarchy, sharing rules, manual sharing, teams, territories |
Sharing can only open access up from the OWD baseline. It cannot grant an object permission. A sharing rule that shares an Account with a user whose profile has no Read on Account has no visible effect.
Where permissions override sharing
Two object permissions bypass the record check:
- View All gives read access to every record of that object, regardless of ownership or sharing.
- Modify All gives read, edit, delete, transfer, and approve on every record of that object.
There are also two system permissions with the same effect across all objects: View All Data and Modify All Data.
Worked example
Maria has a permission set granting Read on Opportunity. The Opportunity OWD is Private, and Maria owns none of the opportunities in question.
- With only the permission set, Maria sees nothing. Object access passes, record access fails.
- If Maria's manager is above her in the role hierarchy, the manager sees Maria's opportunities. That is sharing, and the manager still needs Read on Opportunity.
- If you add View All on Opportunity to Maria's permission set, she sees every opportunity. Sharing is no longer consulted.
Common mistakes
- Adding permissions to fix a "missing record" problem. Check sharing first.
- Widening the OWD to fix a permission problem. If the user cannot see the object at all, the OWD is not the cause.
- Using Modify All for convenience when a sharing rule would do.
Exercise
A user has Read on Case through a permission set. The Case OWD is Private, and the user cannot see a case owned by a colleague in another role branch. Which of these fixes the problem with the least extra access: adding View All on Case, or creating a sharing rule for that group of cases? Explain.
Show answer
Create a sharing rule. The object permission already passes, so the gap is record access. A sharing rule opens only the matching cases to the user. View All on Case would expose every case in the org and ignore sharing completely.