Page History
...
This function assigns each of the roles specified in the ‘ assigningRoles
’ parameter to the specified ‘ user
’ object. It returns true if all the roles are successfully assigned and returns false if not. It includes the following parameters. For implementation details, see the code repository.
Parameter | Description |
---|---|
user | An object representing the user details. |
assigningRoles | A list of strings containing roles that are to be assigned where each string is a role name. |
Code Block |
---|
executeStep(1, { onSuccess: function (context) { // Extracting authenticated subject from the first step. let user = context.currentKnownSubject; assignUserRoles(user, ['exampleRole1', 'exampleRole2']); } }); |
removeUserRoles(user, removingRoles)
This function removes each of the roles specified in the ‘ removingRoles
’ parameter to the given ‘ user
’ object. It returns true if all the roles are successfully removed and returns false if not. It includes the following parameters. For more implementation details, see the code repository.
Parameter | Description |
---|---|
user | An object representing the user details. |
removingRoles | A list of strings that containing roles that are to be removed where each string is a role name. |
Code Block |
---|
executeStep(1, { onSuccess: function (context) { // Extracting authenticated subject from the first step. let user = context.currentKnownSubject; removeUserRoles(user, ['exampleRole1', 'exampleRole2']); } }); |
...
Overview
Content Tools
Activity