Sub topic 10
View All and Modify All: permissions that bypass sharing
This chapter assumes you know how org-wide defaults (OWD), record ownership and the role hierarchy combine to decide record access. It also assumes you can read basic SOQL and assign object permissions in a profile or permission set.
Two kinds of override
Sharing decides which records a user can reach. Some permissions skip that check. They work on the records themselves, so the OWD, the role hierarchy and sharing rules no longer limit the user.
There are two levels:
- Object level: View All and Modify All on a single object, set in a profile or permission set.
- System level: View All Data and Modify All Data, which apply to every object in the org.
| Permission | Scope | Effect on records |
|---|---|---|
| View All | One object | Read every record of that object |
| Modify All | One object | Read, edit, delete and transfer every record of that object |
| View All Data | All objects | Read every record of every object |
| Modify All Data | All objects | Read, edit and delete every record of every object |
Modify All includes View All. Each permission also depends on the basic object permissions. For example, Modify All on Account requires Read, Create, Edit and Delete on Account.
How they differ from sharing
Sharing opens access to specific records. These permissions open access to all records of an object, whatever the OWD is. A user with View All on Account can read a Private account owned by someone in a different branch of the role hierarchy.
The override also does not create share rows. The AccountShare table will not list the user, because the access comes from a permission and not from a share. The UserRecordAccess query still reports the final result.
SELECT RecordId, HasReadAccess, HasEditAccess, HasDeleteAccess
FROM UserRecordAccess
WHERE UserId = '005XXXXXXXXXXXXXXX'
AND RecordId = '001XXXXXXXXXXXXXXX'For a user with Modify All on Account, all three fields return true for any account. A query on AccountShare for the same user would show nothing.
Where these permissions fit in a design
Use them for people whose job is to see or manage everything in one area, such as a sales operations team that maintains all opportunities, or a data steward who cleans up accounts. Giving them the object-level permission is safer than widening the OWD for everyone.
Prefer the object-level permission over the system-level one. View All Data and Modify All Data reach every object, including ones the user has no business role in. Keep them for administrators and integration users.
A related setting appears under the hierarchy chapter: the role hierarchy only grants access upward. View All and Modify All do not depend on the hierarchy at all, so a user at the bottom of the hierarchy with Modify All sees more than the CEO role does.
Common errors
- Expecting a share row. An admin looks for the user in the share table and concludes the user has no access. Check the user's profile and permission sets as well.
- Using Modify All to fix one record. If one user needs one record, use a manual share, a team or a sharing rule instead.
- Forgetting the object permission. View All does nothing useful if Read is not enabled on the object.
- Assuming reports hide records. Reports respect these permissions, so a user with View All sees all records in the report.
Exercise
A user has Read on Opportunity, a Private OWD for Opportunity, and sits in a role with no relationship to the opportunity owner. The user can still open every opportunity. Name the likely cause and one way to confirm it without querying OpportunityShare.
Show answer
The user probably has View All or Modify All on Opportunity, or View All Data or Modify All Data, through a profile or permission set. To confirm, check the user's profile and assigned permission sets in Setup for those permissions, or run a UserRecordAccess query for the user and a record and see HasReadAccess return true despite no matching share row.