Sub topic 5
Choosing an access level: Private, Public Read Only, Public Read/Write and others
This chapter assumes you can navigate Setup, know the standard objects (Account, Contact, Opportunity, Case), and understand that profiles and permission sets grant object permissions. You also need basic SOQL for the inspection example. Here you learn what each org-wide default (OWD) level means, which levels each object offers, and how to choose one.
What the OWD level controls
The OWD level sets the least access that any user with object permissions has to records they do not own. Salesforce evaluates access in this order:
- The user needs the object permission (for example Read on Account) from a profile or permission set.
- For each record, the user gets the OWD baseline for records owned by others.
- Role hierarchy, sharing rules, teams and manual shares can open access further.
Step 3 can only add access. A sharing rule cannot make a record more private than the OWD says. If you set Account to Public Read/Write, you cannot use a sharing rule to hide some accounts from users who can already edit them. You choose the most restrictive level the business needs, then open it up.
The OWD also never reduces access for the owner. Owners always have full access to their own records, whatever the OWD says.
The common levels
| Level | What users who do not own the record can do | Typical use |
|---|---|---|
| Private | Nothing, unless the role hierarchy or another sharing mechanism grants it | Opportunities, sensitive cases, compensation data |
| Public Read Only | View the record, but not edit or delete it | Accounts that everyone should see but only owners should change |
| Public Read/Write | View and edit the record. Delete is not included | Low-risk shared data, such as a shared reference list |
| Public Read/Write/Transfer | View, edit and change the owner | Cases and Leads in queue-based work |
| Public Full Access | View, edit, transfer, delete and share | Campaigns |
| Controlled by Parent | Same access as the parent record | Contacts under Accounts, detail records in a master-detail relationship |
Three details cause most confusion:
- Delete is not part of Public Read/Write. Only the owner, someone above the owner in the hierarchy, or a user with Modify All or Delete permissions can delete the record. Public Full Access is the exception for Campaigns.
- Transfer means changing the Owner field. Without it, a user who can edit a case still cannot reassign it to someone else.
- Controlled by Parent makes the child record inherit the parent's access. A user who can edit the parent account can edit its contacts. This level exists only for objects that have a suitable parent.
Which levels each object offers
Not every object offers every level. Setup shows only the valid options for each row in Sharing Settings. Common patterns:
| Object | Levels available |
|---|---|
| Account, Opportunity | Private, Public Read Only, Public Read/Write |
| Contact | Private, Public Read Only, Public Read/Write, Controlled by Parent |
| Lead, Case | Private, Public Read Only, Public Read/Write, Public Read/Write/Transfer |
| Campaign | Private, Public Read Only, Public Read/Write, Public Full Access |
| Activity | Private, Controlled by Parent |
| User | Private, Public Read Only |
| Price Book | No Access, Use, View Only |
| Custom object | Private, Public Read Only, Public Read/Write. Controlled by Parent for the detail side of a master-detail relationship |
A new custom object defaults to Public Read/Write, so set its OWD deliberately instead of accepting that default. Activities and the detail side of master-detail relationships have no independent choice, because they follow their parent.
Choosing a level
Work from the most sensitive objects down. For each object, ask:
- Is there any user who must not see someone else's record? If yes, choose Private.
- If everyone may see the record, may everyone edit it? If not, choose Public Read Only.
- Is the data truly collaborative, with low harm if anyone edits it? Only then consider Public Read/Write.
- Is the object a child of another, and should it always match the parent's access? Choose Controlled by Parent.
Choosing Private is not the same as choosing safe. A Private OWD can create many sharing rules and manual shares, and these add cost and complexity. Pick the level the data requires, not the strictest one available.
A worked example
A company sells to named accounts. Its sales managers need visibility into their teams' work. Support agents need to read accounts but must not change them. Finance wants opportunity amounts visible only to the sales chain.
| Object | OWD | Reason |
|---|---|---|
| Account | Public Read Only | Everyone needs context, and only owners edit |
| Contact | Controlled by Parent | Contacts follow the account's access |
| Opportunity | Private | Amounts are sensitive. Managers reach them through the role hierarchy |
| Case | Public Read/Write/Transfer | Agents pick up and reassign each other's cases |
Under this design, a sales rep who does not own an account can read it but cannot edit it. A support agent can read accounts but sees no opportunities, unless a sharing rule or team grants it. A sales manager above the owner in the hierarchy sees the owner's opportunities because the role hierarchy opens access upward. Later chapters explain that mechanism.
Seeing the effect in share rows
Salesforce stores explicit sharing in share tables, such as AccountShare. A tighter OWD means more records depend on share rows to be visible. Run this query for one account (replace the placeholder ID):
SELECT Id, AccountId, UserOrGroupId, AccountAccessLevel, RowCause
FROM AccountShare
WHERE AccountId = '001XXXXXXXXXXXXXXX'Under Private, you typically see a row with RowCause of Owner for the owner, plus rows from teams, rules or manual shares. Under Public Read Only or Public Read/Write, the baseline access is not stored as a share row for each user, so the table shows only the owner and explicit extras. An empty result for a non-owner therefore does not prove the user lacks access. For a definitive answer for one user and one record, query UserRecordAccess:
SELECT RecordId, HasReadAccess, HasEditAccess, HasDeleteAccess
FROM UserRecordAccess
WHERE UserId = '005XXXXXXXXXXXXXXX'
AND RecordId = '001XXXXXXXXXXXXXXX'Changing an OWD safely
Changing an OWD triggers a sharing recalculation. Keep these points in mind:
- Making a level more restrictive (for example Public Read Only to Private) can run for a long time on large objects. Salesforce emails you when it finishes. Sharing rules and manual shares that become redundant are handled during the recalculation.
- Making a level less restrictive is usually quicker, because it only adds access.
- Users who relied on the old baseline lose access when you tighten. Before you tighten, list which sharing rules, teams or role-hierarchy changes will replace that access.
- Test in a sandbox with a few real user profiles. Use
UserRecordAccessto compare before and after.
Common mistakes
- Using Public Read/Write on a custom object by default. Salesforce proposes it for new custom objects. Confirm that every user with the object permission may edit every record.
- Expecting a sharing rule to restrict. Rules only open access. To restrict, tighten the OWD.
- Confusing OWD with object permission. The OWD is the record baseline for users who already have the object permission.
- Forgetting that owners keep full access. A Private OWD does not hide a record from its owner.
Exercise
An Opportunity object is set to Public Read Only. A manager wants only the owner's team to edit amounts and wants other departments to see nothing. Can sharing rules achieve this, and what must change?
Show answer
No. Sharing rules only open access, so they cannot take away the Public Read Only baseline that lets every user with Read permission see the records. Set the Opportunity OWD to Private, then open access to the owner's team through the role hierarchy, sharing rules or opportunity teams.
Exercise
A support agent can edit a Case owned by a colleague but gets an error when changing its Owner field. The Case OWD is Public Read/Write. What is the likely cause and fix?
Show answer
Public Read/Write allows viewing and editing but not changing the owner. Set the Case OWD to Public Read/Write/Transfer if all agents should be able to reassign cases, or grant transfer through another mechanism, such as a role above the owner.