Get Role Hierarchy
get
/iam/governance/selfservice/api/v1/roles/{roleid}/hierarchy
Returns role hierarchy list for particular role ID.
Request
Supported Media Types
- application/json
Path Parameters
-
roleid(required): string
Role ID of the role to get the hierarchy details. The details of the inherited from and inherited by roles are returned. The filter parameter can be used return a subset of the roles. The attributes of the inherited from or inherited by are not returned.
Query Parameters
-
hierarchyMode: string
The hierarchyMode query parameter is optional. The supported values are "direct" and "both". Default is "direct"
-
hierarchyType: string
The hierarchyType query parameter is optional. The query parameter enables to filter get the parent or child roles. The supported values are "inheritsFrom" gets the parent roles and "inheritedBy" gets the child roles. Default value is "inheritsFrom"
-
q: string
Search filter to get the records. For example based on Inherits From or Inherited By. If no search filter is specified both the inheritedFrom and inherited by roles are returned.
Response
Supported Media Types
- application/json
200 Response
Successful
Headers
-
ResponseTime: string
Captures the time in milliseconds taken for processing the request.
401 Response
Unauthorized
404 Response
Requested entity not found
500 Response
Internal Server Error
Examples
This example demonstrates the ability to retrieve the hierarchy of a role. This example filters the request by hierarchyType and inheritsFrom. The information shown here is against a pseudo system and serves as a prototype.
cURL Example
curl -H "Content-Type: application/json" -X GET -u username:password https://pseudo.com/iam/governance/selfservice/api/v1/roles/7/hierarchy?hierarchyType=inheritsfrom&hierarchyMode=direct
Example of GET Response Body
The following example shows the contents of the response body in JSON format.
{ "links": [ { "rel": "self", "href": "http://pseudo.com/iam/governance/selfservice/api/v1/roles/43/hierarchy" } ], "count": 1, "inheritedFrom": [ { "links": [ { "rel": "self", "href": "http://pseudo.com/iam/governance/selfservice/api/v1/roles/42" } ], "id": "42", "fields": [ { "name": "Role Name", "value": "parentRole" }, { "name": "ugp_update", "value": 1553028059000 }, { "name": "ugp_createby", "value": 84 }, { "name": "Role Key", "value": "42" }, { "name": "Request Id", "value": "1014" }, { "name": "ugp_create", "value": 1553028059000 }, { "name": "Role Display Name", "value": { "base": "parentRole" } }, { "name": "ugp_updateby", "value": 84 }, { "name": "Role Unique Name", "value": "parentRole" }, { "name": "Role Category Key", "value": 1 }, { "name": "Role Owner Key", "value": 84 }, { "name": "Role Namespace", "value": "Default" } ] } ] }