Sub topic 5
Extending access with permission sets and groups
This chapter assumes you know that a user record needs a user licence and a profile, and that you can open Setup and read basic SOQL. It covers how permission sets add access on top of a profile, and how permission set groups bundle them.
Why permission sets exist
A profile gives every user who holds it the same baseline. Each user has exactly one profile. Real jobs rarely fit a single profile, so creating a new profile for each small difference leads to dozens of near-identical copies.
A permission set is a collection of settings that adds access. It can grant object permissions, field permissions, Apex class access, custom permissions and system permissions such as "Export Reports". A user can have many permission sets at once.
Permission sets only add access. They cannot remove access that the profile already gives. The user's effective access is the combined (most permissive) result of the profile and all assigned permission sets.
Profile or permission set?
| Question | Profile | Permission set |
|---|---|---|
| How many per user? | Exactly one | Zero or many |
| Can it remove access? | Sets the baseline | No, it only adds |
| Ties to a user licence? | Yes, one licence per profile | Optional, it can require a permission set licence |
| Best used for | Minimum common access, login hours, IP ranges | Extra job-specific access |
Permission set groups
When several permission sets always travel together, combine them in a permission set group. You assign the group to a user, and the user receives every permission set in it.
For example, a "Sales Manager" group might contain:
- Edit Opportunities
- Run Forecast Reports
- Approve Discounts
Groups also offer a muting permission set. Muting turns off selected permissions inside that group only. This lets you reuse a shared permission set in a group while switching off one setting for that group. Muting does not change the underlying permission set or other groups.
Creating a permission set
- In Setup, enter "Permission Sets" in Quick Find and open it.
- Click New.
- Enter a Label. The API name is filled in for you, and you use it later in code.
- Choose a License. Select None unless the permissions need a specific user licence. A permission set with a licence can only be assigned to users who hold that licence.
- Save, then open the set and choose the object, field and system settings to grant.
To build a group, open Permission Set Groups, click New Permission Set Group, save it, then add permission sets under Permission Sets in Group. Wait for the group status to show Updated before you assign it, because Salesforce recalculates the group in the background.
Common errors
- The permission set cannot be assigned. Its licence does not match the user's licence. Check the licence on the permission set against the user's profile.
- A permission seems to be missing from a group. A muting permission set in the group may be turning it off.
- A user still lacks access after assignment. Check that the group status is Updated. Also check record visibility, because permission sets grant object access and do not grant access to individual records.
- Too many permission sets per user. Move the common bundle into a group so assignments stay readable.
Exercise
A user's profile denies "Delete" on Accounts. You assign a permission set that grants "Delete" on Accounts. Can the user delete accounts? What happens if you then add that permission set to a group and apply a muting permission set that turns off "Delete"?
Show answer
Yes, the user can delete accounts, because permission sets add to the profile and the combined access is the most permissive. After you add the set to a group with a muting permission set that disables "Delete", the group no longer grants it. The user can delete accounts only if the profile or another assigned permission set grants it.