Sub topic 1
How Salesforce Decides What a User Can Do and See
This chapter gives you the working model for the rest of the tutorial. It explains the layers Salesforce checks when a user tries to open a record, edit a field, or run a feature. Later chapters go into each layer in detail.
Prerequisites
This chapter assumes you already know:
- How to move around Setup and find objects, fields, and users.
- The difference between standard and custom objects and fields.
- What a user record is, including that each user has a username and a profile.
- The basic idea of record sharing: org-wide defaults (OWD) and roles.
You do not need to know any Apex or metadata XML yet. A few examples later use them, and each is explained when it appears.
Two questions, two systems
Salesforce answers two different questions when a user acts on data.
- Can this user work with this kind of data at all? For example: can they read Accounts, edit the Annual Revenue field, or export reports? This is controlled by permissions.
- Can this user work with this particular record? For example: can they open the Acme Corp account? This is controlled by record sharing.
Both checks must pass. A user who has Read permission on Account but no sharing access to the Acme record cannot open that record. A user who owns a record but has no Read permission on Account cannot see it either.
This tutorial is mostly about the first question. Profiles, permission sets, and permission set groups are the tools that grant permissions. Sharing (OWD, roles, sharing rules, manual shares) is covered here only as far as needed to keep the two ideas apart. Chapter "Permissions grant object access; sharing grants record access" returns to it.
What permissions cover
Permissions fall into a few families. Each gets its own chapter.
| Family | What it controls | Example |
|---|---|---|
| Object permissions | Create, Read, Edit, Delete on an object, plus View All and Modify All | Read on Account |
| Field-level security | Read and Edit on one field | Read-only on Account.AnnualRevenue |
| System and user permissions | Org-wide and feature capabilities | Export Reports, Manage Users |
| App, tab, and Apex access | Which apps, tabs, Apex classes, and pages a user can reach | The Sales app is visible |
| Custom permissions | Feature switches your own code or flows check | Approve_Discounts |
Some settings are not permissions in this sense. Page layouts, record types assigned as default, and login hours or IP ranges are configuration that only profiles hold. The profiles chapter covers these.
The three building blocks
Three kinds of metadata grant permissions.
- Profile. Every user has exactly one. It is the baseline. It holds permissions and also several settings that exist nowhere else.
- Permission set. A collection of permissions that you assign to users on top of their profile. A user can have many.
- Permission set group. A bundle of permission sets, usually matching a job function. You assign the group instead of each set. A group can include a muting permission set that switches off chosen permissions inside the group.
How the pieces combine
The core rule is that access is additive. Salesforce takes the union of everything granted by the profile, every directly assigned permission set, and every permission set in every assigned group. If any one source grants a permission, the user has it.
Two consequences follow.
- A permission set can only add access to what the profile already gives. You cannot use a plain permission set to take something away.
- To lower access you must remove it from every source that grants it. If the profile grants Delete on Account and a permission set also grants it, removing it from only one leaves the user with it.
Muting is the one exception, and it is limited. A muting permission set inside a group removes permissions from that group's contribution only. If the profile or a different permission set outside the group grants the same permission, the user still has it.
A worked example
Jane has the Standard User profile. Her access to the Account object comes from three places.
| Source | Account Read | Account Delete | AnnualRevenue field |
|---|---|---|---|
| Profile | Yes | No | No access |
| Permission set Account_Viewer | Yes | No | Read |
| Group Sales Representative (contains Opportunity_Editor, which grants Account Delete; its muting set removes Delete) | No | Muted | No access |
Jane's effective access is: Read on Account, no Delete, and Read on AnnualRevenue. The Delete grant in the group is removed by muting. If the profile had granted Delete, muting would not remove it.
A concrete permission set
Here is the Account_Viewer permission set from the example, written in Metadata API format. You will see this format again in the deployment chapter. For now, read it as a list of grants.
<?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 objectPermissions block grants Read on Account and nothing else. The fieldPermissions block grants Read, not Edit, on one field. Note that field access is granted separately from object access. A user with Read on a field but no Read on its object still cannot reach the field through that object.
Where licenses fit
Permissions are only grantable if the user's license allows them. The user license (tied to the profile) sets the outer boundary of what the user can ever be given. Permission set licenses unlock specific features for a permission set. If you cannot find a permission in a permission set, a missing license is a common cause. The licensing chapter covers this.
Common mistakes
- Mixing up permissions and sharing. Granting View All on an object bypasses record sharing for that object. Granting Read does not. Choose deliberately.
- Expecting a permission set to restrict. It will not. Look at the profile and other sets first.
- Looking at one source only. A user's access is the union. When debugging, check the profile, each direct permission set, and each group.
- Assuming the profile is the only place for a setting. Default app, default record type, page layout assignment, and login restrictions are profile-only.
Why the model is shaped this way
Older orgs put almost everything on profiles. That forces one profile per variation of access, so profile counts grow and become hard to maintain. The modern approach keeps profiles small and puts job-specific access into permission sets, then bundles those into groups. You will build exactly this in the minimum access chapter. The mental model to keep is: profile for the baseline, permission sets for additions, groups for bundles, muting for targeted removal, sharing for record scope.
Exercise
A user's profile grants Delete on Case. You add the user to a permission set group whose muting permission set removes Delete on Case. Can the user still delete cases (assuming sharing allows it)? Explain why.
Show answer
Yes. Muting only removes permissions from what the group's own permission sets contribute. The profile still grants Delete on Case, and access is the union of all sources, so the user keeps it. To remove it you must change the profile (or move the user to a profile without Delete, such as Minimum Access) and grant Delete through permission sets only where needed.
Exercise
A user has Read on Account through a permission set but cannot open one particular account. Which of the two systems is most likely responsible, and what would you check first?
Show answer
Record sharing. Object permission is already granted, so the next check is whether the record is owned by or shared with the user. Check the org-wide default for Account, the role hierarchy, sharing rules, and manual shares.