Sub topic 9
Organizing field access with permission set groups
This chapter assumes you know how to set field-level security (FLS) on a profile or permission set, and that you understand the difference between object permissions and field permissions. It focuses on how permission set groups bundle field access, how the permissions combine, and the mistakes that cause surprises.
Why bundle permission sets
Field access usually follows a job role, not a single field. A sales manager needs Read and Edit on Account.AnnualRevenue, Read on a handful of custom fields, and access to the Opportunity object. If you assign one permission set per feature, you end up assigning a dozen sets to each user. Onboarding becomes error-prone, and an audit has to inspect every assignment.
A permission set group is a container that combines several permission sets into one assignable unit. When you assign the group to a user, the user receives the combined permissions of every permission set in it. The group does not hold permissions of its own. It holds references to permission sets.
The usual pattern is to build small permission sets around capabilities, then compose them into groups that match roles.
| Layer | Example | Purpose |
|---|---|---|
| Permission set | Account Notes Access | One capability: Read and Edit on `Account.Internal_Notes__c` |
| Permission set | Opportunity Forecast Fields | Read on forecast fields |
| Permission set group | Sales Manager | Combines the sets a sales manager needs |
| User | A sales manager | Assigned the Sales Manager group |
How the combined access is calculated
Salesforce grants the union of everything the user has. If any profile, permission set, or group assigned to the user gives Read on a field, the user can read it. Permissions are additive. A permission set cannot take away access that the profile gives, except through a muting permission set, described below.
The effective field access for a user is the union of:
- The user's profile.
- Every permission set assigned directly.
- Every permission set inside each assigned permission set group.
Because of this, the profile should be the floor. Keep it minimal and add access upward through permission sets.
Muting permission sets
Sometimes a shared permission set grants more than one role should have. For example, the Account Notes Access set grants Edit on Internal_Notes__c, but the Support Analyst group should only read it. Cloning the set creates a maintenance burden. A muting permission set solves this.
A muting permission set belongs to exactly one permission set group. It lists permissions that the group should suppress. The suppression applies only to the permissions that arrive through that group. It does not change the underlying permission sets, and it does not affect the same permission sets when they are assigned to a user in another way.
Key rules for muting:
- Muting removes access only within the group. If the user also gets Edit on the field from the profile or from a directly assigned permission set, that access remains.
- A group can have one muting permission set.
- You can mute field permissions, object permissions, and other permission types that the muting set supports.
- Muting cannot add access. It only subtracts.
The consequence is important for auditing. If someone says "Support Analysts can edit the notes field," you must check the group, its muting set, and the user's other assignments.
Building a group in Setup
- Create the small permission sets first, with FLS set on each field. In Setup, open the permission set, choose Object Settings, pick the object, and set Read Access and Edit Access for each field.
- In Setup, open Permission Set Groups and choose New Permission Set Group.
- Enter a label and API name, then save.
- Open the group and add the permission sets.
- Optionally create a muting permission set from the group's page and select the permissions to suppress.
- Assign users to the group.
Setting Edit on a field also requires Read. Salesforce enforces this when you save the permission set. If you tick Edit, Read is selected for you.
Group status and why it matters
A group has a status that reflects whether its combined permissions are current.
- Updated means the group's calculated permissions match its contents.
- Outdated means a component permission set or the muting set changed and the group has not recalculated.
- Updating means recalculation is in progress.
- Failed means recalculation did not complete, and you need to fix the cause and try again.
When you edit a permission set that belongs to a group, Salesforce recalculates the group in the background. Until the status returns to Updated, users may not have the new access. This is a common source of "I added the field but my test user still cannot see it" reports. Check the status before debugging anything else.
Required fields, dependencies, and what groups cannot fix
Grouping organizes access. It does not repair gaps in the layers underneath.
- A user needs object Read before field Read means anything. If a group contains FLS for
Account.Internal_Notes__cbut no permission set in the user's access grants Read on Account, the user sees nothing. - A group cannot grant access that a permission set license does not allow. If a permission set requires a license and the user lacks it, the group assignment is rejected or the permission is not applied.
- FLS in a group does not change sharing. A user still sees only the records that sharing rules allow.
- A group does not change Apex behavior. Code running in system mode still ignores FLS, and the group only affects code that enforces user mode.
Representing groups as metadata
Permission set groups deploy as PermissionSetGroup metadata. The group file lists the member permission sets and the muting permission set. The FLS itself stays in the permission set files you saw earlier.
<?xml version="1.0" encoding="UTF-8"?>
<PermissionSetGroup xmlns="http://soap.sforce.com/2006/04/metadata">
<label>Sales Manager</label>
<description>Field and object access for sales managers</description>
<permissionSets>Account_Notes_Access</permissionSets>
<permissionSets>Opportunity_Forecast_Fields</permissionSets>
<mutingPermissionSets>Sales_Manager_Mute</mutingPermissionSets>
</PermissionSetGroup>Deploy the member permission sets and the muting set in the same deployment as the group, or earlier. If the group references a set that does not exist in the target org, the deployment fails.
Common mistakes
| Mistake | Effect | Fix |
|---|---|---|
| Putting field access on profiles | Access cannot be reused or muted, and audits get harder | Keep profiles minimal and move field access to permission sets |
| Building one huge permission set per role | Sets overlap and drift apart | Make small capability sets and compose them in groups |
| Expecting muting to remove profile access | The user keeps the field | Remove it from the profile or reduce the profile's access |
| Testing before the group recalculates | The new access seems missing | Wait for the status to read Updated |
| Reusing one muting set across groups | Not possible, since a muting set belongs to one group | Create one muting set per group |
Verifying a group with a query
You can inspect what a user has by querying field permissions. This query lists the field permissions that come from permission sets, including those in groups, for one user. Replace the username before you run it.
Id userId = [SELECT Id FROM User WHERE Username = '[email protected]' LIMIT 1].Id;
List<FieldPermissions> perms = [
SELECT Field, PermissionsRead, PermissionsEdit, Parent.Label
FROM FieldPermissions
WHERE SobjectType = 'Account'
AND ParentId IN (
SELECT PermissionSetId
FROM PermissionSetAssignment
WHERE AssigneeId = :userId
)
];
for (FieldPermissions fp : perms) {
System.debug(fp.Parent.Label + ' | ' + fp.Field
+ ' | read=' + fp.PermissionsRead
+ ' | edit=' + fp.PermissionsEdit);
}Salesforce creates a permission set assignment for each member permission set when a user gets a group, so this query sees the group's contributions. The query does not apply muting, so treat it as an upper bound. To confirm real access, run the test as the user with System.runAs, as covered in the testing chapter.
Exercises
Exercise
A user is assigned the Support Analyst permission set group. One member set grants Edit on Account.InternalNotes_c. The group's muting set removes Edit. The user's profile also grants Edit on that field. Can the user edit the field? Explain.
Show answer
Yes. Muting suppresses only permissions that come through the group. The profile grants Edit separately, and effective access is the union of all sources. To remove the access, change the profile.
Exercise
You added Read access to a new custom field in a permission set that belongs to a group. A test user cannot see the field a minute later. Name two things to check before changing the FLS.
Show answer
First, check the group's status and wait until it reads Updated, because the group recalculates in the background. Second, confirm the user has object Read on the object, since field access has no effect without it. You can also check whether the user has the group assigned and whether a muting set suppresses the field.
Exercise
Why is a muting permission set better than cloning a permission set and removing one field from the clone?
Show answer
A muting set leaves the original permission set as the single source of truth. Future changes to that set flow into every group that uses it, while the muting set only subtracts the specific permissions that group should not have. A clone drifts out of date and doubles the number of sets to maintain.