List RBAC Roles
GET https://infrahub-api.nexgencloud.com/v1/auth/roles
Returns a list of existing Role-Based Access Control (RBAC) roles that can be assigned to users, granting them permissions and policies associated with the role, enabling them to execute specific resource actions.
Parameters
No parameters.
Attributes
status boolean
Indicates the success status of the request to retrieve RBAC roles.
message string
A message describing the request.
roles array of objects
An array of roles
objects containing details about the permissions and policies associated with each role. To learn more about the attributes of the role
object, click here.
curl -X GET "https://infrahub-api.nexgencloud.com/v1/auth/roles" \
-H "accept: application/json"\
-H "api_key: YOUR API KEY"
{
"status": true,
"message": "Getting RBAC roles success",
"roles": [
{
"policies": [
{
"description": "Gives read-only access to all resources",
"id": 2,
"name": "policy:ReadPermissions"
}
],
"name": "example-role",
"permissions": [
{
"resource": "Environment",
"permission": "environment:create",
"id": 2
}
],
"description": "",
"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.