Skip to main content

List Permissions

GET https://infrahub-api.nexgencloud.com/v1/auth/permissions

Returns a list of permissions that can be granted to users providing them with access to a specific resource action.


Parameters


No parameters.


Attributes


status boolean

Indicates the status of the request to retrieve a list of permissions, true indicates success, while false indicates error.


message string

A message describing the status of the request.


permissions array of objects

An array of objects containing information about permissions that can be applied to users.

Show child attributes

permission string

The permission name, in this case, environment:list, indicates that when granted to a user, it permits the "list" action for the environment resource.


endpoint string

When this permission is granted, users can utilize the corresponding endpoint path.


method string

The HTTP method associated with the permission.


id integer

The unique identifier for the permission.


created_at date-time

The timestamp when the permission was created.


resource string

The resource to which the permission grants access (e.g., environment, virtual machine, volume).


Example request
curl -X GET "https://infrahub-api.nexgencloud.com/v1/auth/permissions" \
-H "accept: application/json"\
-H "api_key: YOUR API KEY"
Response
{
"status": true,
"message": "Getting permissions success",
"permissions": [
{
"permission": "environment:list",
"endpoint": "^/core/environments/?$",
"method": "GET",
"id": 1,
"created_at": "2023-05-08T06:25:00",
"resource": "Environment"
},
{...}
]
}

Returns


The response will provide the status of the request along with an array of permissions objects each containing details about permissions which can be granted to users. 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.



Back to top