Sub topic 3
Org-wide defaults: the most restrictive baseline
This chapter assumes you know how to navigate Setup, you understand standard and custom objects, and you know that profiles and permission sets grant object permissions. Earlier chapters introduced the layers of data access and record ownership. This chapter covers the setting that decides how restrictive the whole model starts: org-wide defaults.
What org-wide defaults are
Org-wide defaults (OWD) set the baseline level of record access for each object. They answer one question: if a user does not own a record, and nothing else grants access, what can that user do with it?
Every other sharing mechanism in this tutorial can only open access beyond the OWD. Role hierarchy, sharing rules, manual sharing, and teams all add access. None of them can take away access that the OWD already grants. So you set the OWD to the most restrictive level any user in the org needs, then open access up from there.
OWD works on top of object permissions, not in place of them. A user needs the Read permission on an object before the OWD matters for that object. Object permissions say whether a user can work with an object at all. The OWD says which records of that object the user can reach.
The access levels
You set the OWD per object in Setup > Sharing Settings. The options depend on the object, but the common ones are:
| OWD setting | What non-owners can do | Typical use |
|---|---|---|
| Private | Nothing. Only the owner and users above the owner in the role hierarchy have access. | Sensitive records such as invoices or salary data |
| Public Read Only | View all records. Edit only records they own. | Reference data that everyone reads but few change |
| Public Read/Write | View and edit all records. | Collaborative records with low sensitivity |
| Public Read/Write/Transfer | View, edit, and transfer ownership. Available for leads and cases. | Queue-driven work such as lead routing |
| Controlled by Parent | Access follows access to the parent record. | Detail records in a master-detail relationship |
| Public Full Access | View, edit, delete, and transfer. Available for campaigns. | Shared marketing records |
Delete is not granted by Public Read/Write. A user can delete only records they own, records that a hierarchy or sharing grant gives Full Access to, or records they can delete through the "Modify All" or "Delete" object permissions.
Internal and external defaults
Each object has two OWD settings:
- The internal default applies to employees and other internal users.
- The external default applies to portal, community, and guest users.
The external default can be the same as the internal one or more restrictive, but never more open. A common design is Public Read Only internally and Private externally, so partners see only their own records.
Enabling the external defaults feature separates the two values. Once it is on, you must review both columns when you change an object.
Controlled by Parent
For the child side of a master-detail relationship, the OWD is fixed to Controlled by Parent. A user can see, edit, or delete a child record only if the user has the matching access to its parent record. You cannot share the child on its own.
Lookup relationships do not work this way. A custom object with a lookup to Account has its own OWD and its own sharing. The master-detail choice is therefore also a sharing decision, so make it deliberately.
Contacts are a related case. Contact can be Controlled by Parent, which makes access follow the account, or it can have its own OWD.
The Grant Access Using Hierarchies option
Beside each object's OWD sits a checkbox called Grant Access Using Hierarchies. When it is on, users higher in the role hierarchy get the same access as the users below them. It is on by default for standard objects.
For custom objects you can turn it off. Then the role hierarchy no longer opens access upward for that object. Only the owner and explicit shares count. Turning it off suits data that even managers should not see by default. The next chapter covers the hierarchy in detail.
Effect on sharing tables
The OWD decides whether Salesforce stores explicit share rows at all. When an object is Public Read/Write, everyone already has the maximum sharing access, so sharing rules and manual shares add nothing. Salesforce does not create a share table for that object, and the Sharing button does not appear on its records.
When the OWD is more restrictive, Salesforce keeps share rows to record who has been granted extra access. A later chapter shows how to query these rows.
flowchart TD
A[User opens a record] --> B{Has object permission?}
B -- No --> X[No access]
B -- Yes --> C{Is the user the owner?}
C -- Yes --> Y[Access granted]
C -- No --> D{Does the OWD allow it?}
D -- Yes --> Y
D -- No --> E{Do hierarchy, rules, shares, or teams grant it?}
E -- Yes --> Y
E -- No --> XThe flowchart above is a simplification, but it shows the order in which to reason. The diagram block below uses the required format for the same flow.
Worked example
A company has a custom object, Invoice__c, with a lookup to Account. Sales reps create invoices, and only finance managers should see invoices they do not own.
- Open Setup > Sharing Settings.
- In the Organization-Wide Defaults section, click Edit.
- Find
Invoiceand set Default Internal Access to Private. - Leave Grant Access Using Hierarchies on, so a rep's manager can see the rep's invoices.
- Click Save.
Salesforce then queues a recalculation of sharing for the object. Reps now see only their own invoices and invoices owned by users below them in the hierarchy. Finance managers get access in the next chapters through a role placement or a sharing rule.
Suppose you had left the OWD at Public Read Only. Every rep could then read every invoice, and no sharing rule could restrict that. To tighten access later, you would have to lower the OWD and then rebuild access for everyone who needs it.
Changing an OWD
Moving to a more open setting is cheap. Salesforce recalculates, and existing explicit shares that are now redundant are removed. Moving to a more restrictive setting is costly, for two reasons:
- Users lose access immediately after recalculation finishes. Anything that depended on the open default, such as a report, a dashboard, or an integration user, can break.
- Existing sharing rules and manual shares remain, but you must check that they cover everyone who still needs access.
Salesforce warns you when a change will remove access. In a large org, recalculation can take a long time, and during that period the changes may not yet be in effect.
Test an OWD change in a sandbox first, using real user profiles and a sample of real records.
Common errors
- Setting the OWD too open and expecting rules to restrict it. Sharing mechanisms only add access. If everyone can already read invoices, no rule can hide them.
- Confusing OWD with object permissions. A Private OWD does not stop a user with "View All" or "Modify All" on the object. Those permissions bypass sharing for that object.
- Forgetting the "View All Data" and "Modify All Data" system permissions. They override sharing for every object. Give them to as few users as possible.
- Choosing master-detail without considering sharing. The child has no sharing of its own, so you cannot give one user access to the child alone.
- Ignoring the external default. A community can quietly expose records when the external OWD is too open.
- Expecting the Sharing button on an open object. If the OWD is Public Read/Write, the button is absent because there is nothing to add.
Exercises
Exercise
The OWD for Invoice__c is Private and Grant Access Using Hierarchies is off. A sales rep owns an invoice, and the rep's manager sits one role above. Can the manager open the invoice, assuming no other sharing exists and the manager has no "View All" or "Modify All" permission on the object?
Show answer
No. With the hierarchy option off, access does not flow upward. The manager needs a sharing rule, manual share, or other grant to see it.
Exercise
An admin wants a sharing rule that hides Case records from users who currently see all cases through a Public Read/Write OWD. Will this work, and what should the admin do instead?
Show answer
It will not work, because sharing rules only add access. The admin must lower the OWD, for example to Private, test the change in a sandbox, and then rebuild access for the users who still need it.
Exercise
Why does a detail record in a master-detail relationship not appear in the OWD list with its own editable setting?
Show answer
Its OWD is fixed to Controlled by Parent. Access to the detail record follows the user's access to the master record.