Sub topic 3
Object permissions: Create, Read, Edit, Delete, View All, Modify All
This chapter assumes you know what a profile is, can navigate Setup, and understand that org-wide defaults and roles control record sharing. Object permissions are the first layer of access a user needs on any object.
The six permissions
Object permissions decide which operations a user can perform on records of an object. Salesforce has four basic permissions and two elevated ones.
| Permission | What it allows | Requires |
|---|---|---|
| Read | View records the user can access | None |
| Create | Create new records | Read |
| Edit | Update records the user can access | Read |
| Delete | Delete records the user can access | Read and Edit |
| View All | View every record of the object, regardless of sharing | Read |
| Modify All | View, edit, delete, and transfer every record, regardless of sharing | Read, Create, Edit, Delete, View All |
The Requires column is enforced. If you tick Delete, Salesforce also ticks Read and Edit. If you clear Read, it clears everything that depends on it.
Basic versus elevated permissions
Read, Create, Edit, and Delete work together with sharing. A user with Edit on Account can only edit the accounts that sharing lets them see and edit.
View All and Modify All override sharing for one object. They are often called "object-level superuser" permissions. Use them sparingly, because they expose every record of the object, including records owned by users in other roles.
The org-wide equivalents are the system permissions View All Data and Modify All Data. These apply to every object at once.
Granting the permissions
You can grant object permissions in a profile or in a permission set. Both use the same settings, and the result is the union of everything the user has been granted. Here is a permission set that gives read-only access to Account:
<?xml version="1.0" encoding="UTF-8"?>
<PermissionSet xmlns="http://soap.sforce.com/2006/04/metadata">
<label>Account Viewer</label>
<description>Read-only access to Accounts and the Annual Revenue field</description>
<hasActivationRequired>false</hasActivationRequired>
<objectPermissions>
<allowCreate>false</allowCreate>
<allowDelete>false</allowDelete>
<allowEdit>false</allowEdit>
<allowRead>true</allowRead>
<modifyAllRecords>false</modifyAllRecords>
<object>Account</object>
<viewAllRecords>false</viewAllRecords>
</objectPermissions>
<fieldPermissions>
<editable>false</editable>
<field>Account.AnnualRevenue</field>
<readable>true</readable>
</fieldPermissions>
</PermissionSet>The six flags in objectPermissions map directly to the six permissions in the table. allowRead is the Read permission, and viewAllRecords and modifyAllRecords are View All and Modify All. The fieldPermissions block is field-level security, covered in the next chapter.
Common errors
- Granting Edit and expecting access to all records. Edit only applies to records sharing already exposes. If the user still can't see a record, check sharing, not permissions.
- Using Modify All for convenience. It also bypasses sharing for deletes and transfers. Prefer changing sharing rules or roles when the need is only to see more records.
- Removing a permission in a profile but leaving it in a permission set. Access is additive, so the user keeps it.
Exercise
A user has Read and Edit on Opportunity, and their role only lets them see their own opportunities. A teammate suggests granting Modify All Data to fix the problem. What narrower option would give the user visibility of all opportunities, and what would it still not allow?
Show answer
Grant View All on Opportunity. It lets the user see every opportunity without changing sharing. It does not allow editing or deleting opportunities they can't already edit, because Edit still depends on sharing. Modify All Data is far broader because it applies to every object.