Skip to main content

role_assignment_users

Creates, updates, deletes, gets or lists a role_assignment_users resource.

Overview

Namerole_assignment_users
TypeResource
Idokta.users.role_assignment_users

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_assigned_roles_for_userselectsubdomainexpandLists all roles assigned to a user (identified by userId)
get_user_assigned_roleselectsubdomainRetrieves a role assigned to a user (identified by userId). The roleAssignmentId parameter is the unique identifier for either a standard role assignment object or a custom role resource set binding object.
assign_role_to_userinsertsubdomaindisableNotificationsAssigns a standard role to a user.

You can also assign a custom role to a user, but the preferred method to assign a custom role to a user is to create a binding between the custom role, the resource set, and the user. See Create a role resource set binding.

> Notes:
> * The request payload is different for standard and custom role assignments.
> * For IAM-based standard role assignments, use the request payload for standard roles. However, the response payload for IAM-based role assignments is similar to the custom role's assignment response.
unassign_role_from_userdeletesubdomainUnassigns a role assignment (identified by roleAssignmentId) from a user (identified by userId)
assign_all_apps_as_target_to_role_for_userexecsubdomainAssigns all apps as target to an APP_ADMIN role
assign_app_target_to_admin_role_for_userexecsubdomainAssigns an OIN app target for an APP_ADMIN role assignment to an admin user. When you assign the first app target, you reduce the scope of the role assignment.
The role no longer applies to all app targets, but applies only to the specified target.

Assigning an OIN app target overrides any existing app instance targets of the OIN app.
For example, if a user was assigned to administer a specific Facebook instance, a successful request to add an OIN app target with facebook for appName makes that user the admin for all Facebook instances.
assign_app_instance_target_to_app_admin_role_for_userexecsubdomainAssigns an app instance target to an APP_ADMIN role assignment to an admin user. When you assign the first OIN app or app instance target, you reduce the scope of the role assignment.
The role no longer applies to all app targets, but applies only to the specified target.

> Note: You can target a mixture of both OIN app and app instance targets, but can't assign permissions to manage all instances of an OIN app and then assign a subset of permission to the same OIN app.
> For example, you can't specify that an admin has access to manage all instances of the Salesforce app and then also manage specific configurations of the Salesforce app.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
subdomainstringThe domain of your organization. This can be a provided subdomain of an official okta domain (okta.com, oktapreview.com, etc) or one of your configured custom domains. (default: my-org)
disableNotificationsbooleanSetting this to true grants the user third-party admin status
expandstringAn optional parameter used to return targets configured for the standard role assignment in the embedded property. Supported values: targets/groups or targets/catalog/apps

SELECT examples

Lists all roles assigned to a user (identified by userId)

SELECT
*
FROM okta.users.role_assignment_users
WHERE subdomain = '{{ subdomain }}' -- required
AND expand = '{{ expand }}';

INSERT examples

Assigns a standard role to a user.

You can also assign a custom role to a user, but the preferred method to assign a custom role to a user is to create a binding between the custom role, the resource set, and the user. See Create a role resource set binding.

> Notes:
> * The request payload is different for standard and custom role assignments.
> * For IAM-based standard role assignments, use the request payload for standard roles. However, the response payload for IAM-based role assignments is similar to the custom role's assignment response.

INSERT INTO okta.users.role_assignment_users (
subdomain,
disableNotifications
)
SELECT
'{{ subdomain }}',
'{{ disableNotifications }}'
;

DELETE examples

Unassigns a role assignment (identified by roleAssignmentId) from a user (identified by userId)

DELETE FROM okta.users.role_assignment_users
WHERE subdomain = '{{ subdomain }}' --required;

Lifecycle Methods

Assigns all apps as target to an APP_ADMIN role

EXEC okta.users.role_assignment_users.assign_all_apps_as_target_to_role_for_user 
@subdomain='{{ subdomain }}' --required;