- URL:https://<roles-url>/getRolesForUser(POST only)
- Required Capability:Default administrator role | All authorized privileges
- Version Introduced:10.1
Description
This operation returns a list of role names that have been assigned to a particular user account. This operation is used by the authorization module in ArcGIS Server to determine the collective privileges of a requesting user account.
Request parameters
| Parameter | Description | 
|---|---|
| username | The name of the user for whom to return the roles. Example  | 
| filter (Optional) | A filter to be applied to the resultant role set. | 
| maxCount | The maximum number of results to return for this query. Example  | 
| f | The response format. The default response format is html. Values: html | json | pjson | 
Example usage
Below is a sample POST request for getRolesForUser that demonstrates how to get all the roles that have been assigned to user 'jwhite':
POST /webadaptor/admin/security/roles/getRolesForUser HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []
username=jwhite&filter=&maxCount=20&f=jsonJSON Response syntax
{
  "roles": ["<role1>", "<role2>"],
  "hasMore": <true|false>
}