List Policies
GET https://infrahub-api.nexgencloud.com/v1/auth/policies
Returns a list of policies that can be added to RBAC roles. Assigning these policies to a user provides them with access to commonly used sets of permissions, allowing specific resource actions.
Parameters
No parameters.
Attributes
status boolean
Indicates the status of the request to retrieve the list of policies. A value of true
indicates success, while false
indicates an error.
message string
A message describing the status of the request to retrieve the list of policies.
policies array of objects
An array containing information about policies, which are groups of permissions that can be applied to a user.
Show child attributes
name string
The name of the policy.
id integer
The unique identifier for the policy.
created_at date-time
The timestamp when the policy was created.
permissions array of objects
An array of objects containing information about permissions within the policy.
Show child attributes
id integer
The unique identifier for the permission.
resource string
The resource to which the permission grants access (e.g., Environment, Virtual machine, Volume).
permission string
The permission's name. For instance, environment:list
indicates that when assigned to a user, it allows them to perform the "list" action on the environment resource.
description string
A description of the permissions granted by the policy.
curl -X GET "https://infrahub-api.nexgencloud.com/v1/auth/policies" \
-H "accept: application/json"\
-H "api_key: YOUR API KEY"
{
"status": true,
"message": "Getting policies success",
"policies": [
{
"name": "policy:AllPermissions",
"id": 1,
"created_at": "2023-05-08T06:25:17",
"permissions": [
{
"id": 1,
"resource": "Environment",
"permission": "environment:list"
},
{...}
],
"description": "Grants all permissions to all resources"
},
{...}
]
}
Returns
The response will provide the status of the request, along with an array of policies
objects, each containing details about the policy, including the name, ID, description, and timestamp of creation. Additionally, it will include an array of permissions
objects corresponding to the permissions the policy contains. Within the permissions
objects, you'll find information such as the permission name, ID, endpoint for which the permission grants access, timestamp of creation, and the resource to which the permission grants access.