7.0

Table Of Contents
"disabled" : false,
"principalId" : {
"domain" : "example.mycompany.com",
"name" : "susan"
},
"tenantName" : "MYCOMPANY1",
"name" : "Tony Anteater"
} ]
}
Syntax for Assigning a User to a Role
You can use the REST API identity service to assign a user to a role.
Input
Use the supported input parameters to control the command output.
Parameter Description
URL https://$host/identity/api/authorization/tenants/$tenantId/principals/$principalId/rol
es/roleId
$host Specifies the host name and fully qualified domain name or IP address of the
vRealize Automation identity server.
$token Specifies a valid HTTP bearer token with necessary credentials.
$tenantId Specifies the ID of the tenant.
$principalId Specifies the ID of the user in name@domain format.
$roleId Specifies the ID of the user role.
Example: curl Command
The following example command string submits a request to assign the user tony in the domain
example.mycompany.com to the tenant administrator role. It provides empty braces for the required
JSON payload. See Syntax for Searching LDAP or Active Directory for a User for more information about
getting the user name and domain values.
curl --insecure -H "Content-Type: application/json"
-H "Authorization: Bearer $token"
"https://$host/identity/api/authorization/tenants/development/principals/
susan@example.mycompany.com/roles/CSP_TENANT_ADMIN/" --data "{}"
Example: JSON Output
If the command is successful, the HTTP response body is empty except for a 204 No Content status
statement.
Syntax for Displaying all Roles Assigned to a User
You can use the REST API identity service to display all of the roles assigned to a user.
Programming Guide
VMware, Inc. 33