Retrieve RBAC Role Details
GET https://infrahub-api.nexgencloud.com/v1/auth/roles/{id}
Retrieves the details of a specified Role-Based Access Control (RBAC) including the permissions and policies associated with the role. Include the ID of the role in the path to retrieve its details.
Path parameters
id integer
Required
The ID of the RBAC role for which to retrieve details. In this example, the RBAC role with an ID of "64" was retrieved.
Attributes
status boolean
Indicates the success status of the request to retrieve RBAC roles.
message string
A message describing the request to retrieve details on the RBAC role.
role object
Returns the roles
object containing details about the permissions and policies associated with the specified RBAC role. To learn more about the attributes of the roles
object, click here.
curl -X GET "https://infrahub-api.nexgencloud.com/v1/auth/roles/{id}" \
-H "accept: application/json"\
-H "api_key: YOUR API KEY"
{
"status": true,
"message": "Getting RBAC role detail success",
"roles": {
"policies": [
{
"description": "Gives read-only access to all resources",
"id": 2,
"name": "policy:ReadPermissions"
}
],
"name": "example-role",
"permissions": [
{
"resource": "Environment",
"permission": "environment:list",
"id": 1
}
],
"description": "Example RBAC role.",
"created_at": "2024-02-08T09:45:34",
"id": 64
}
}
Returns
The response will indicate the status of the request, with true
indicating success, and will include an array of roles
objects containing the configurations of the RBAC roles. Within these roles
objects, you'll find details about the permissions and policies assigned to each role, the role ID, creation timestamp, as well as the name and description of the roles.