SessionPermSetActivation
The SessionPermSetActivation object represents a permission set assignment activated during an individual user session. When a SessionPermSetActivation object is inserted into a permission set, an activation event fires, allowing the permission settings to apply to the user’s specific session.
Introduced in API version 36.0.
create(), delete(), describeLayout(), describeSObjects(), query(), retrieve()
If you include session-based permission sets in a permission set group, the permissions in them don’t require session-based activation for users assigned to the group.
-
As of Summer ’20 and later, only users who have one of these permissions can access this object:
- View Setup and Configuration
- Manage Session Permission Set Activations
-
Type: reference
-
Properties: Create, Filter, Group, Sort
-
Description:
The session ID related to this permission set assignment for its duration.
This is a relationship field.
-
Relationship name: AuthSession
-
Relationship type: relationship
-
Refers to: AuthSession
- Type: textarea
- Properties: Create, Filter, Group, Nillable, Sort
- Description: The session details, such as device used and browser.
-
Type: reference
-
Properties: Create, Filter, Group, Nillable, Sort
-
Introduced: API version 53.0
-
Description:
The permission set group ID related to this permission set group assignment and user for its duration.
This is a relationship field.
-
Relationship name: PermissionSetGroup
-
Relationship type: relationship
-
Refers to: PermissionSetGroup
-
Type: reference
-
Properties: Create, Filter, Group, Nillable, Sort
-
Description:
The permission set ID related to this permission set assignment and user for its duration.
This is a relationship field.
-
Relationship name: PermissionSet
-
Relationship type: relationship
-
Refers to: PermissionSet
-
Type: reference
-
Properties: Filter, Group, Sort
-
Description:
The user ID of the user to whom this permission set assignment applies for its duration.
This is a relationship field.
-
Relationship name: User
-
Relationship type: relationship
-
Refers to: User
Use SessionPermSetActivation to create a permission set available only for a specified session’s duration. For example, create permission sets that provide access to specific applications only during authenticated sessions.
In the following Apex example, an identified session is activated after session information is submitted via a button. Successful activation results in a confirmation message displayed to the user.
To deactivate a session-based permission set for the current session, delete the matching SessionPermSetActivation record. Removing that record ends the activation for that permission set in that session. In this example, a deactivate() method is added to the class from the previous example.