PermissionSetGroup organizes permission sets into a packageable bundle for a job function or task. It defines which permission sets belong to the group, optional permission muting, and whether an associated active session is required. Individual permissions are defined in the referenced PermissionSet components, not directly in the group.
The metadata definition is not a complete statement of a user's effective access. You must also consider member permission definitions, muting, user assignments, and applicable session state. Group composition is also different from user assignment: adding a permission set to a group does not mean assigning that group to a user.
Key Elements
| Element | What the Element Controls |
|---|---|
fullName |
The metadata component name, inherited from the base Metadata type. This identifies the group rather than a runtime record ID. |
label |
Required. The permission set group's display label. |
permissionSets |
References the PermissionSet components included in the group. Inspect those components to determine the individual permissions they contribute. |
mutingPermissionSets |
References a MutingPermissionSet containing permissions to disable within the group. |
hasActivationRequired |
Whether the group requires an associated active session. Allowed values are true and false; the default is false. |
status |
The recalculation state: Updated means current; Outdated means recalculation is required; Updating means recalculation is in progress; Failed means recalculation failed. |
Behavior and Constraints
Permission composition: The names in permissionSets identify dependencies, not the permissions themselves. A group's permission configuration consists of its member permission sets together with any referenced muting permission set. Muting suppresses permissions within the group; it does not replace or rewrite the member permission-set definitions.
Session activation: When hasActivationRequired is true, the group definition and a user assignment alone are insufficient to establish that the group's permissions are active in a particular session. Session activation and recalculation are separate concerns: status describes recalculation, not whether a user's session has activated the group.
Administrative access: Viewing this metadata type requires at least one of these permissions:
- View Setup and Configuration
- Manage Session Permission Set Activations
- Assign Permission Sets
Editing it requires Manage Profiles and Permission Sets. These permissions authorize administration of the metadata; they are not permissions granted by the group itself.
Runtime membership and assignments: The similarly named runtime PermissionSetGroup sObject, or Salesforce database record, participates in relationships that are distinct from metadata references:
-
PermissionSetGroupComponentlinks a permission set to a group throughPermissionSetIdandPermissionSetGroupId. -
PermissionSetAssignmentlinks a user to a permission set or group. For a group assignment,AssigneeIdidentifies the user andPermissionSetGroupIdidentifies the group.
Do not put a group ID in PermissionSetAssignment.AssigneeId to add a permission set to a group. These runtime fields hold record IDs, not the metadata component names used in permissionSets.
Business-rule checks: A community-recommended pattern for validation rules is to include a CustomPermission in a member permission set and check $Permission.xxx. The same pattern has been recommended for Flow expressions. This creates an indirect dependency through the custom permission and member permission set. The expression tests the custom permission, not exclusive membership in a particular group.
Deployment and Retrieval
Permission set groups are stored in the permissionsetgroups directory with the .permissionsetgroup extension. For example, the group Finance_Mgmt_PermSetGroup is stored as permissionsetgroups/Finance_Mgmt_PermSetGroup.permissionsetgroup.
The type can be packaged and supports the * wildcard in a package.xml manifest. Use PermissionSetGroup as the manifest type name.
Retrieve the dependencies with the group. Retrieving PermissionSetGroup requires also retrieving its related PermissionSet components. When muting is configured, the referenced MutingPermissionSet is also needed to interpret the group's permission configuration. The group file alone does not contain the individual permission definitions.
Check assignment readiness at assignment time. A deployment-test report observed INVALID_CROSS_REFERENCE_KEY with the message You can only assign users to permission set groups that have the "Updated" status. The runtime group's status was Updating, although Setup showed Updated outside the deployment. An earlier Setup inspection therefore did not establish readiness when the test inserted the user assignment.
For Apex tests that need group recalculation, the discussion recommends Test.calculatePermissionSetGroup(). This is a test mechanism, not a production recalculation control. It also should not be confused with a way to hold a group in the transient Updating state for branch testing.
Relationships
The group's outgoing references define its member and muting configuration. Delegated-administration configuration can reference the group in the other direction, but that reference does not itself assign a user to the group. Runtime composition and user-assignment records are separate from these metadata element references.
References
-
PermissionSet:permissionSets -
MutingPermissionSet:mutingPermissionSets
Referenced By
-
DelegateGroup:permissionSetGroups
Reported Issues
-
Deployment tests can fail on group assignment despite an Updated status seen in Setup. In a 2021 sandbox report, tests passed when run directly but failed during deployment with
INVALID_CROSS_REFERENCE_KEYand the requirement that the group haveUpdatedstatus. A check immediately before assignment foundUpdating. The follow-up recommendsTest.calculatePermissionSetGroup()for test recalculation. Deployment assignment failure discussion. -
Adding a permission set to a group requires a component relationship, not a user assignment. A January 2024 answer corrected code that used a group ID as
PermissionSetAssignment.AssigneeId. It usedPermissionSetGroupComponentwith the permission set and group record IDs instead. Group composition versus assignment. -
Member permission-set names can be queried through component records. In a February 2022 discussion, the answer used the
PermissionSetGroupComponentschild relationship and selectedPermissionSet.Name, rather than expecting a list field of names on the runtime group record. Querying member permission sets. - Testing an Updating branch may require a substitute query result. An October 2022 answer explained that a test could not force the group's background updating process into the desired state. It recommended dependency injection: separate the status query from the business logic and replace that query unit with fixed results during the test. Testing recalculation-status branches.
-
A validation-rule check should target a custom permission rather than the group directly. A May 2022 answer recommended placing a
CustomPermissionin a member permission set and checking$Permission.xxx. This tests possession of that permission, not exclusive membership in the group. Validation-rule permission checks. -
Flow decisions can use a custom permission instead of matching group names. A November 2023 answer recommended a custom permission in one or more member permission sets and a
$Permissionexpression. It distinguished this permission check from determining actual group assignment, which requires querying the runtime group and assignment records. Flow permission checks versus membership queries.
Common Questions
How do I retrieve a PermissionSetGroup and its permissions?
Retrieve the PermissionSetGroup together with its related PermissionSet components. Include the referenced MutingPermissionSet when muting is configured. The group file contains references, not the individual permission definitions.
Does assigning a permission set group activate its permissions?
Assignment alone is not enough when hasActivationRequired is true; the group requires an associated active session. Effective access also depends on the member permission sets and muting configuration.
Why does a deployment test say the permission set group must have Updated status?
The group may be Updating when the test inserts the assignment, even if Setup showed Updated earlier. Check the runtime state at assignment time. The reported test-specific recommendation is Test.calculatePermissionSetGroup().
How do I add a permission set to a permission set group in Apex?
Use a runtime PermissionSetGroupComponent record with PermissionSetId and PermissionSetGroupId. Use PermissionSetAssignment for assigning a user to a permission set or group, not for defining group composition.
Can a validation rule check a permission set group?
The community-recommended approach is to put a CustomPermission in a member permission set and check $Permission.xxx. That evaluates the custom permission, not exclusive membership in the group.