Requires permissions::modify permission.
resources is a top-level field on the policy object, not nested inside statements.
Resource names use TGRN format, e.g. tgrn:tg::nodes:node/{uid} or tgrn:tg::access-apps:app/{uid}. Use * to match all resources of a type.
Action names must match the exact permission identifier accepted by the API, e.g. nodes::configure:apigw.
Security
JWTAuthorizer
- Mock serverhttps://apidocs.trustgrid.io/_mock/v2/policy
- https://api.trustgrid.iohttps://api.trustgrid.io/v2/policy
curl -i -X POST \
https://apidocs.trustgrid.io/_mock/v2/policy \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"description": "My policy description",
"name": "my-policy",
"resources": [
"string"
],
"conditions": {
"all": {
"eq": {
"tg:node:tags:environment": [
"production"
],
"tg:node:tags:another-tag": [
"always-match"
]
},
"ne": {
"tg:node:tags:environment": [
"staging"
],
"tg:node:tags:another-tag": [
"dont-match"
]
}
},
"any": {
"eq": {
"tg:node:tags:environment": [
"production"
],
"tg:node:tags:another-tag": [
"always-match"
]
},
"ne": {
"tg:node:tags:environment": [
"staging"
],
"tg:node:tags:another-tag": [
"dont-match"
]
}
},
"none": {
"eq": {
"tg:node:tags:environment": [
"production"
],
"tg:node:tags:another-tag": [
"always-match"
]
},
"ne": {
"tg:node:tags:environment": [
"staging"
],
"tg:node:tags:another-tag": [
"dont-match"
]
}
}
},
"statements": [
{
"actions": [
"string"
],
"effect": "allow"
}
]
}'