As of December 31st, 2023 ThreadFix 2.X has reached End of Life and is no longer supported. For any further information please contact the Success and Implementation team.
Add Application Role to User - API
/rest/{version}/users/{userId}/role/app
Descriptor | Value |
---|---|
HTTP Method | POST |
Description | Gives the user permissions in the provided role for the specified application. These permissions will add onto any other permissions the user has from their global role, attached groups, and other team/app permissions. To obtain the userId value in the endpoint, run the Get Users - API call first. The user's id value in the response is the userId value that you use in this endpoint. To obtain the roleId value in the endpoint, run the Get Roles - API call first. The group's id value in the response is the groupId value that you use in this endpoint. |
Required Permission | Manage Users |
Version Introduced | 2.5.1.12 |
Changes in 2.7.5 | Added "testEnvironment", "releaseFrequency", "isInternal", and "policyStatuses" to the REST call response. |
Â
Request Header Parameters
Parameter | Value | Required | Description |
---|---|---|---|
Accept | String | Yes | A value of ‘application/json’ must be provided. |
Â
Request POST Data Parameters
Parameter | Value | Required | Description |
---|---|---|---|
appId | Integer | Yes | The ID of the application to assign permissions for. |
roleId | Integer | Yes | The ID of the role to give the user for that application. |
Sample Call:
curl -H 'Accept: application/json' -H "Authorization: APIKEY {apiKey}" --data "appId=1&roleId=3" https://localhost:8443/threadfix/rest/latest/users/2/role/app
Sample Output:
{
"message": "",
"success": true,
"responseCode": -1,
"object": {
"id": 2,
"user": {
"id": 2,
"name": "mfreeman",
"displayName": "Morgan",
"type": "LOCAL"
},
"organization": {
"id": 1,
"name": "Example Team"
},
"role": null,
"accessControlApplicationMaps": [
{
"id": 1,
"application": {
"id": 1,
"name": "Example App",
"url": null,
"applicationCriticality": {
"id": 2,
"name": "Medium"
}
},
"policyStatuses": [],
"description": null,
"releaseFrequency": "UNKNOWN",
"testEnvironment": null,
"isInternal": false
"role": {
"id": 3,
"displayName": "Developer Role"
}
}
],
"allApps": false
}
}
www.threadfix.it | www.coalfire.com
Copyright © 2024 Coalfire. All rights reserved.
This Information Security Policy is CoalFire - Public: Distribution of this material is not limited.