Role Assignments

List Role Assignments

Changed on

Lists the role assignments defined within an environment.

  • If the user filter is present, will only return the role assignments of that user (supports multiple).
  • If the tenant filter is present, will only return the role assignments in that tenant (supports multiple).
  • If the role filter is present, will only return role assignments that are granting that role (supports multiple).
  • If the resource filter is present, will only return role assignments for resource instances of that resource type.
  • If the resource_instance filter is present, will only return role assignments for that resource instance.

Providing both tenant and resource_instance filters will only return role assignments if the resource instance is in that tenant. If multiple tenants are received, the last tenant will be compared with the resource instance.

get/v2/facts/{proj_id}/{env_id}/role_assignments

Request

  • Base URL
    https://api.permit.io (the document declares no server; this is the origin it was published from)
  • Auth
    HTTP bearer

Path parameters

proj_idstring required

Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").

env_idstring required

Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").

Query parameters

userstring[]

optional user(s) filter, will only return role assignments granted to this user(s). Split larger sets into successive requests of at most 100 values each.

rolestring[]

optional role(s) filter, will only return role assignments granting this role(s). Split larger sets into successive requests of at most 100 values each.

tenantstring[]

optional tenant(s) filter, will only return role assignments granted in that tenant(s). Split larger sets into successive requests of at most 100 values each. Note: when combined with resource_instance, only the last tenant value is used to resolve that instance, while the tenant filter itself still applies to every value. If the instance exists under that last tenant, the result is skewed by that resolution; if it does not, the request fails with 404 even when the instance exists under another tenant in the list. Either outcome depends on the order of the values, so pass a single tenant alongside resource_instance.

resourcestring

optional resource type filter, will only return role assignments granted on that resource type.

resource_instancestring

optional resource instance filter, will only return role assignments granted on that resource instance.

detailedboolean

Whether to return full details about the user, tenant and role

include_total_countboolean

If true, returns the list of role assignments and the total count.

pageinteger

Page number of the results to fetch, starting at 1.

per_pageinteger

The number of results per page (max 1000).

Response

Successful Response

OR
OR
OR

Example response

[
  {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "user": "jane@coolcompany.com",
    "role": "admin",
    "tenant": "stripe-inc",
    "user_id": "7c60d51f-b44e-4682-87d6-449835ea4d11",
    "role_id": "405d8375-3514-403b-8c43-83ae74cfe022",
    "tenant_id": "40ef0e48-a11f-4963-a229-e396c9f7e733",
    "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
    "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",
    "environment_id": "40ef0e48-a11f-4963-a229-e396c9f7e7c4",
    "created_at": "2019-08-24T14:15:22Z"
  }
]

Changes

    • info

      for the query request parameter per_page, the max was increased from 100.00 to 1000.00

    • info

      query request parameter detailed was deprecated

    • info

      query request parameter include_total_count was deprecated