Pangolin icon

Pangolin

Interact with the Pangolin API

Actions142

Role → Grant roles access to a resource, replacing any existing ones.

AI-generated

Summary

Set the access roles for a specified resource by replacing any existing role assignments with those provided.

Inputs

  • Resource ID (required) — The unique identifier of the resource to which roles will be granted access.
  • Body (required) — JSON object containing the list of role IDs to grant access to the resource, replacing any existing roles.
  • Options — Optional settings including whether to return the raw full response data.

Output shape

A single response object representing the result of the role assignment operation, or an array if the response data is array-shaped.

The response shape depends on the API's reply; if 'Raw Response' option is enabled, the full response is returned as is. Otherwise, arrays in the response are split into individual items. Errors will be returned per item if 'continueOnFail' is enabled.

Examples

Example 1: Grant roles with IDs [1,2,3] access to a resource with ID 'abc123'.

Set 'Resource ID' to 'abc123' and specify the Body as {"roleIds": [1, 2, 3]}.

Discussion