Assign roles to users dynamically
Description
Estimated time to complete: 10 minutes
In the use case Create test users and roles, you created two users and a role and then assigned the role users to the users. In this use case, you are going to:
-
Assign an inactive status to one of the users
-
Add a condition to the role so that it applies only to active users
Goals
After completing this use case, you will know how to:
-
Change the properties of a user
-
Add a condition to a role
Prerequisites
Before you start, make sure you have:
-
A basic understanding of these Ping Identity concepts:
-
Advanced Identity Cloud admin console
-
Hosted pages
-
-
Completed the use case in Create test users and roles
Tasks
Task 1: Assign an inactive status to a user
In this task, you select one of the users you created in Create test users and roles and change their status to inactive.
-
In the Advanced Identity Cloud admin console, go to Identities > Manage > Alpha realm - Users.
-
Click on the user
acruse. -
On the user details page, change the Status from the default value
activetoinactiveand save the change.
Task 2: Add a condition to a role
In this task, you create a condition so that the role applies only to active users.
-
In the Advanced Identity Cloud admin console, go to Identities > Manage > Alpha Realm - Roles.
-
Click on the
employeerole and then click on Settings.
-
In the Condition panel, click on Set up to create the following condition for the role and save the condition:
Field Value A conditional filter for this role
Enable
Assign to alpha_user if Any conditions are met
AnyAlpha_user properties
Statuscontains
isBlank
active
-
(Optional) Click on Add Rule to add another condition and take a moment to browse the other conditions that can apply to roles.
Validation
In Create test users and roles, you created the employee role
and manually assigned it to braman and acruse. To validate this use
case, make sure the role is no longer assigned to acruse.
-
In the Advanced Identity Cloud admin console, go to Identities > Manage > Role Members.
-
Make sure
bramanis in the list butacruseis not. -
Change the status of
bramantoinactiveandacrusetoactive, then make sureacruseis in the list butbramanis not.