Sub topic 11
Muting permission sets: removing permissions within a group
This chapter assumes you know what a permission set is, how a permission set group bundles several of them, and that permissions in Salesforce are additive. You should also be comfortable reading Metadata API XML.
Why muting exists
Permissions are additive. If a user holds three permission sets and only one grants Delete on Account, the user can delete Accounts. Before muting, the only way to remove that access inside a group was to edit the shared permission set. That change would affect every other group and user that used the set.
A muting permission set solves this. It lives inside one permission set group and switches off selected permissions for that group only. The underlying permission sets stay unchanged.
Consider a Sales Representative group that bundles Account_Viewer and Opportunity_Editor. Suppose Opportunity_Editor also grants Delete on Opportunity, which is correct for managers but too much for reps. You have two bad options: split the set into two, or give reps a different copy of it. Muting gives a third option. Keep one Opportunity_Editor set, and mute the Delete permission in the rep group.
How muting works
A muting permission set is a special kind of permission set. You create it inside a permission set group, and it can only be used in that group. It does not grant anything. It only lists permissions to turn off.
When Salesforce calculates what a group gives a user, it follows these steps:
- It combines all permissions from every permission set in the group.
- It subtracts the permissions listed in the group's muting permission set.
- The result is the group's effective set of permissions, which Salesforce combines with the user's profile and any other assigned permission sets.
The last step matters. Muting only affects what the group contributes. It does not reduce permissions that come from somewhere else.
What you can mute
You can mute object permissions and field permissions, and also many system and user permissions. Typical targets are:
- Object permissions: Create, Read, Edit, Delete, View All, Modify All.
- Field permissions: Read and Edit on individual fields.
- User permissions such as Export Reports or Manage Users.
- Access to Apex classes, Visualforce pages, custom permissions, tabs, and similar items.
Not everything that a profile or permission set controls can be muted. Items such as default record types or page layout assignments are not permissions in this sense, so they are outside what muting can change. Check the permission set group documentation for the current list of supported items.
Creating a muting permission set in Setup
- In Setup, open Permission Set Groups and select the group.
- Open the Muting Permission Set area and create one. Give it a label and API name.
- Edit the muting permission set and select the permissions to mute. The page works like a normal permission set, but a selection means "remove this", not "grant this".
- Save. The group recalculates, and its status moves through Updating and back to Updated.
A group can have only one muting permission set. If you need different muting for different jobs, create different groups.
Muting in metadata
A muting permission set is stored as a MutingPermissionSet metadata type. Its content looks like a permission set, and it lists the permissions to mute.
<?xml version="1.0" encoding="UTF-8"?>
<MutingPermissionSet xmlns="http://soap.sforce.com/2006/04/metadata">
<label>Mute Opportunity Delete</label>
<objectPermissions>
<allowCreate>false</allowCreate>
<allowDelete>true</allowDelete>
<allowEdit>false</allowEdit>
<allowRead>false</allowRead>
<modifyAllRecords>false</modifyAllRecords>
<object>Opportunity</object>
<viewAllRecords>false</viewAllRecords>
</objectPermissions>
</MutingPermissionSet>In this file, allowDelete set to true means "mute Delete". A false value means the muting set does not touch that permission. This is the opposite of what a reader expects from a normal permission set, so read these files with care.
The group then references the muting set with a mutingPermissionSets element next to its permissionSets elements:
<?xml version="1.0" encoding="UTF-8"?>
<PermissionSetGroup xmlns="http://soap.sforce.com/2006/04/metadata">
<label>Sales Representative</label>
<description>Everything a sales rep needs, without deleting opportunities</description>
<permissionSets>Account_Viewer</permissionSets>
<permissionSets>Opportunity_Editor</permissionSets>
<mutingPermissionSets>Mute_Opportunity_Delete</mutingPermissionSets>
</PermissionSetGroup>Deploy the muting permission set before, or together with, the group that references it.
What muting does not do
Muting has limits. Most surprises come from forgetting them.
- It does not override other sources. If a user's profile grants Delete on Opportunity, muting it in the group does nothing for that user. Another permission set assigned directly to the user, or another group, can also still grant it.
- It does not remove sharing access. Muting changes object and field permissions. It does not change record access from roles, sharing rules, or manual shares.
- It does not change the original permission sets.
Opportunity_Editorstill grants Delete to everyone who receives it through another route. - It applies only within its group. A muting set cannot be assigned to users directly.
Because of the first limit, a muting-based design works best when users have the Minimum Access profile, covered in a later chapter. If the profile grants little, the groups become the main source of access, and muting becomes reliable.
Muting versus the alternatives
| Approach | What changes | Cost |
|---|---|---|
| Edit the shared permission set | Everyone who has that set | Can break other groups and users |
| Split into smaller permission sets | Structure of the permission sets | More sets to maintain, which can make the model harder to read |
| Muting permission set in a group | Only that group | One extra component to track per group |
Muting is a good fit when one group needs almost everything in a broad permission set, but a few items must be withheld. If you find yourself muting large parts of a permission set, the set is probably too broad, and splitting it is cleaner.
Checking the result
A muting permission set changes the group's effective permissions, but no query returns a simple "after muting" list. Verify by checking the actual user:
- Assign the group to a test user.
- In Setup, open the user and review Permission Set Group Assignments, then use View Summary or the Field Accessibility and Object Settings views to see the effective access.
- Sign in as the test user (log in as that user, where your org allows it) and try the action.
You can also confirm who holds the group and its muting status with SOQL:
SELECT Assignee.Name, PermissionSetGroup.DeveloperName, PermissionSetGroup.Status
FROM PermissionSetAssignment
WHERE PermissionSetGroup.DeveloperName = 'Sales_Representative'
ORDER BY Assignee.NameIf a user still has access you muted, check these in order:
- Is the group status
Updated? A group that showsUpdatingorOutdatedhas not finished recalculating. - Does the profile grant the permission?
- Does another permission set or group assigned to the user grant it?
- Is the permission one that muting supports?
Common mistakes
- Putting a permission in the muting set and expecting it to remove access that comes from the profile.
- Reading
truein a muting file as "granted". - Creating a muting set and forgetting to add it to the deployment, so the group in production grants more than in the sandbox.
- Muting entire objects in many groups, which hides the real design problem.
- Testing before the group has finished recalculating.
Exercise
A user is assigned the Sales Representative group, which includes a muting permission set that mutes Delete on Opportunity. The user can still delete Opportunities. Name three places the permission might come from, and say which one muting can never fix.
Show answer
The permission may come from (1) the user's profile, (2) another permission set or permission set group assigned to the user, or (3) a permission set inside the same group that was not muted correctly, or a group that has not finished recalculating. Muting can never fix the profile or any other directly assigned source, because a muting set only subtracts from the group that contains it. The fix for the profile is to remove Delete there, ideally by moving the user to the Minimum Access profile.
Exercise
In a MutingPermissionSet metadata file, an objectPermissions block for Account has allowRead set to true and allowEdit set to false. What does this mean for the group?
Show answer
The group no longer grants Read on Account, because true means "mute this permission". Edit is not muted, since false means the muting set leaves it alone. If the group's permission sets grant Edit, the group still contributes Edit.