Get Authorizations
Queries for a list of authorizations using a list of parameters. The size of the result set can be retrieved by using the Get Authorization Count method.
Method
GET /authorization
Parameters
Query Parameters
Name | Description |
---|---|
id | Filter by the id of the authorization. |
type | Filter by authorization type. (0=global, 1=grant, 2=revoke). See the User Guide for more information about authorization types. |
userIdIn | Filter by a comma-separated list of userIds. |
groupIdIn | Filter by a comma-separated list of groupIds. |
resourceType | Filter by an integer representation of the resource type. See the User Guide for a list of integer representations of resource types. |
resourceId | Filter by resource id. |
sortBy | Sort the results lexicographically by a given criterion. Valid values are
resourceType and resourceId .
Must be used in conjunction with the sortOrder parameter. |
sortOrder | Sort the results in a given order. Values may be asc for ascending order or desc for descending order.
Must be used in conjunction with the sortBy parameter. |
firstResult | Pagination of results. Specifies the index of the first result to return. |
maxResults | Pagination of results. Specifies the maximum number of results to return. Will return less results if there are no more results left. |
Result
A JSON array of authorization objects. Each group object has the following properties:
Name | Value | Description |
---|---|---|
id | String | The id of the authorization. |
type | Integer | The type of the authorization. (0=global, 1=grant, 2=revoke). |
permissions | String | An array of Strings holding the permissions provided by this authorization. |
userId | String | The id of the user this authorization has been created for. The value "*" represents a global authorization ranging over all users. |
groupId | String | The id of the group this authorization has been created for. |
resourceType | Integer | An integer representing the resource type. See the User Guide for a list of integer representations of resource types. |
resourceId | String | The resource Id. The value "*" represents an authorization ranging over all instances of a resource. |
Response Codes
Code | Media type | Description |
---|---|---|
200 | application/json | Request successful. |
400 | application/json | Returned if some of the query parameters are invalid, for example if a sortOrder parameter is supplied, but no sortBy is specified. See the Introduction for the error response format. |
Example
Request
GET /authorization?userIdIn=jonny1,jonny2
Response
Status 200.
[{"id":"anAuthorizationId",
"type": 0,
"permissions": ["ALL"],
"userId": "jonny1",
"groupId": null,
"resourceType": 1,
"resourceId": "*"},
{"id":"anotherAuthorizationId",
"type": 0,
"permissions": ["CREATE", "READ"],
"userId": "jonny2",
"groupId": null,
"resourceType": 1,
"resourceId": "*"}]