Sub topic 11
Muting permission sets: removing permissions within a group
This chapter assumes you know what a permission set is and how a permission set group bundles several of them. You should also know the difference between object permissions and field-level security.
The problem muting solves
Permission sets are additive. If a group contains two permission sets and one grants Delete on Account, every user with that group can delete Accounts. Before muting, you had two bad options: split the permission set into smaller pieces, or build a near-duplicate with the permission removed.
A muting permission set removes specific permissions from one group only. The original permission sets stay unchanged and can still be used in other groups or assigned directly.
How muting works
A muting permission set looks like a permission set, but it lists permissions to take away instead of grant. A group can contain one muting permission set. Salesforce calculates the group's access in two steps:
- Combine every permission in the group's regular permission sets.
- Subtract every permission listed in the muting permission set.
The result is the group's combined permissions. The user's profile and any permission sets assigned directly to the user are not affected by the mute. If those grant the same permission, the user still has it.
Creating a muting permission set
In Setup, open the permission set group and choose to add a muting permission set. Then pick the permissions to mute, such as Delete on Account or Edit on a field. A muting permission set can mute these kinds of permissions:
- Object permissions
- Field permissions
- Custom permissions
- Many system and user permissions
- Apex class, Visualforce page, and tab access
In metadata, the group references the muting permission set with a mutingPermissionSets element:
<?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 Accounts</description>
<permissionSets>Account_Viewer</permissionSets>
<permissionSets>Opportunity_Editor</permissionSets>
<mutingPermissionSets>No_Account_Delete</mutingPermissionSets>
</PermissionSetGroup>Common errors
- Expecting a mute to override the profile. A mute only affects permissions that come through that group. If the user's profile grants Delete, the mute does not remove it.
- Expecting a mute to apply to other groups. Each muting permission set belongs to one group. Another group that contains the same permission set still grants the permission.
- Muting something that is not granted. Nothing happens. Check that the permission really comes from the group.
- Forgetting recalculation. After you change a mute, the group recalculates. Wait until its status returns to Updated before testing.
When to use muting
Muting works best for a small exception to a standard bundle. If you find yourself muting large numbers of permissions in a group, the underlying permission sets are probably too broad. Split them by job function instead.
Exercise
A user has the Sales Representative group, which includes a muting permission set that removes Delete on Account. The user's profile grants Delete on Account. Can the user delete Accounts? Why?
Show answer
Yes. The mute only subtracts permissions from the group's own combined access. The profile grants Delete separately, and the user's total access is the union of the profile, direct permission sets, and the group, so the profile's grant still applies. To remove it, change the profile or move the user to a profile that does not grant Delete.