Sub topic 5
System and User Permissions
This chapter assumes you know how to navigate Setup, you understand standard and custom objects, and you know that a profile is assigned to each user. It covers the permissions that are not tied to a specific object or field. These are the switches that let a user run reports, export data, manage users, or modify metadata.
What system and user permissions are
Object permissions and field-level security answer the question "what can this user do with this data?" System and user permissions answer a different question: "what can this user do in the org itself?"
Salesforce groups these settings under a few names in Setup:
- System permissions control org-wide abilities, such as "Modify Metadata Through Metadata API Functions" or "Manage Users".
- User permissions control feature access, such as "Run Reports", "Export Reports", or "API Enabled".
- App permissions are feature permissions tied to a specific cloud or product, such as Sales or Service.
In the Metadata API, all of these appear as userPermissions entries. On a profile page and a permission set page, they are listed under "System Permissions" and "App Permissions". The XML name for a permission is an identifier like ViewSetup or ApiEnabled, which can differ from the label shown in the UI.
Each permission is a checkbox: it is either granted or not. There is no "read only" version of a system permission.
Common permissions and what they allow
The table below lists permissions you will meet often. Treat the labels as a guide, because Salesforce renames some of them between releases.
| Permission (label) | What it allows | Risk if over-granted |
|---|---|---|
| API Enabled | Connect to the org through the API (integrations, Data Loader, most external tools) | Bulk data extraction outside the UI |
| Run Reports | Run reports the user can see | Low |
| Export Reports | Export report data to a file | Data leaves the org |
| Manage Users | Create and edit users, and assign profiles and permission sets | Privilege escalation |
| View Setup and Configuration | Open Setup and read configuration | Exposes design details |
| Modify Metadata Through Metadata API Functions | Change configuration through the Metadata API | Unreviewed changes to the org |
| Author Apex | Write and edit Apex code | Code that bypasses controls |
| View All Data | Read every record of every object | Bypasses sharing |
| Modify All Data | Edit and delete every record of every object | Bypasses sharing and object permissions |
"View All Data" and "Modify All Data" deserve extra care. They grant record access across all objects at once, which makes them the system-wide counterparts of the per-object "View All" and "Modify All" settings covered in the object permissions chapter.
Where the permissions live
A system permission can be granted in two places:
- On a profile. Every user has exactly one profile. A permission on the profile applies to every user with that profile.
- In a permission set. A permission set adds permissions to individual users or groups of users. Permission set groups bundle several permission sets.
The user's effective access is the union of everything granted. If the profile grants "Run Reports" and a permission set grants "Export Reports", the user has both. A permission set can add a system permission, but it cannot take one away from the profile. Removing a permission that the profile grants requires changing the profile, or using a muting permission set inside a permission set group (covered in a later chapter). A muting permission set only affects permissions that arrive through the group, so it does not override the profile.
Dependencies between permissions
Some permissions need others to work. Salesforce enforces this when you save.
- Enabling "Export Reports" requires "Run Reports".
- Enabling "Modify All Data" automatically brings along "View All Data".
- Enabling "Manage Users" is linked to "View Setup and Configuration" and other permissions that the user needs to open the relevant pages.
When you tick a permission that has required permissions, Setup turns the required ones on for you. When you try to untick a permission that others depend on, Setup warns you or removes the dependent permissions as well. Keep this in mind when you review a permission set: a permission you did not choose may appear because another one required it.
In metadata, the dependency is not applied for you. If you deploy a permission set that enables a permission without its prerequisite, the deployment can fail with an error that names the missing permission. Fix it by adding the prerequisite to the same file.
Permissions in metadata
In a permission set file, each granted system permission is a userPermissions element. The next example grants three permissions.
<?xml version="1.0" encoding="UTF-8"?>
<PermissionSet xmlns="http://soap.sforce.com/2006/04/metadata">
<label>Report Exporter</label>
<description>Run and export reports</description>
<hasActivationRequired>false</hasActivationRequired>
<userPermissions>
<enabled>true</enabled>
<name>RunReports</name>
</userPermissions>
<userPermissions>
<enabled>true</enabled>
<name>ExportReport</name>
</userPermissions>
<userPermissions>
<enabled>true</enabled>
<name>ApiEnabled</name>
</userPermissions>
</PermissionSet>Only permissions that are enabled need to appear in a permission set. Profile files list every permission, with enabled set to true or false, so they are much longer. Prefer permission sets when you want files that are easy to read and review.
Choosing profile or permission set
Putting system permissions in permission sets keeps profiles small and makes changes easier to audit. A common rule of thumb:
- Put the permissions that every user of a kind needs, such as "Run Reports", in a job-function permission set, not in the profile.
- Put powerful permissions, such as "Modify All Data" or "Author Apex", in their own named permission sets. A named set shows up in an assignment audit, and removing it takes one action.
- Keep permissions on the profile only when they cannot be placed elsewhere. A few settings exist only on profiles (the next chapter covers them).
Common errors
- Granting API Enabled broadly. Many integrations need it, but it also lets users export data with tools you may not monitor. Grant it to named users or a dedicated integration permission set.
- Using Modify All Data as a shortcut. It fixes a "missing access" error by removing all access control. Find the actual missing object, field, or sharing setting instead.
- Expecting a permission set to remove a profile permission. Permission sets only add. See the note on muting above.
- Confusing the label with the API name. When searching metadata, use the API name, such as
ExportReport, not the UI label. - Forgetting that a user permission is independent of record access. "Run Reports" lets a user run a report, but the report still shows only records the user can see.
Exercise
A user's profile grants "Run Reports". You assign a permission set that grants "Export Reports" and, in the same org, the profile has "Export Reports" disabled. Does the user have "Export Reports"? Then, a manager asks you to stop the user from running reports. Where must you change the setting, and why can't a permission set do it?
Show answer
Yes, the user has "Export Reports", because effective permissions are the union of the profile and all permission sets, and the permission set adds it. To stop the user from running reports, you must remove "Run Reports" from the profile (or move the user to a profile without it), because a permission set can only add permissions. A muting permission set would work only for a permission that comes from a permission set group, not one that comes from the profile. Note that removing "Run Reports" also affects "Export Reports", which depends on it.
Exercise
You deploy a permission set file that contains only <userPermissions> for ExportReport, and the deployment fails. What is the most likely cause, and what is the fix?
Show answer
Export Reports depends on Run Reports, and a metadata deployment does not enable prerequisites automatically. Add a userPermissions element with <name>RunReports</name> and <enabled>true</enabled> to the same file (or confirm that the target org's users already receive it from another source), then deploy again.