Skip to content

Find allowed resources

Return resources on which the user is allowed to perform the requested action.

GET/permissions/resources

Query parameters

NameTypeDescriptionRequired
userId
string
Id of the target user or me for the current user
resourceType
| "ACCOUNT"
| "ENTITY"
| "GROUP"
| "POLICY"
| "WHITELIST"
| "TRADELINK_CUSTODIAN"
| "TRADELINK_ENTITY"
| "TRADELINK_PLEDGE"
| "WORKSPACE"
| "WORKSPACE_RULE"
action
| "READ"
| "EDIT"
| "SEND"
| "STAKE"
| "DEPLOY_CONTRACT"
| "EXECUTE_CONTRACT"
| "ACTIVATE_TOKEN"
| "RECEIVE"
| "SIGN_MESSAGE"
| "SIGN_DIGESTS"
| "TRADELINK_PLEDGE"
| "TRADELINK_REPLEDGE"
| "TRADELINK_FORCE_UNPLEDGE"
| "TRADELINK_SETTLE"
| "TRADELINK_WITHDRAW"
| "TRADELINK_ARBITRATE"
| "CREATE_ACCOUNT_WITH_POLICY"
Allowed action on the resource

Response schema

{
// User ID
userId: string;
// The requested action
action: string;
resources: Array<{
// Type of the resource
resourceType:
| "ACCOUNT"
| "ENTITY"
| "GROUP"
| "POLICY"
| "WHITELIST"
| "TRADELINK_CUSTODIAN"
| "TRADELINK_ENTITY"
| "TRADELINK_PLEDGE"
| "WORKSPACE"
| "WORKSPACE_RULE"
;
// ID of resource on which the action is allowed
resourceId: string;
}
>
;
}

Examples

bash
curl \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer {jwt}" \
  "$API_BASE_URL/permissions/resources"
ts
const url = "<base-url>/permissions/resources";

const headers = {
  "Content-Type": "application/json",
  Authorization: "Bearer <jwt>"
};

fetch(url, { headers }).then(res => {
  console.log(res)
});
python
import requests

url = "<base-url>/permissions/resources"

headers = {
  "Content-Type": "application/json",
  "Authorization": "Bearer <jwt>"
}

print(requests.get(url, headers=headers))