Skip to main content
POST
Error

Authorizations

Authorization
string
header
required

A StarTree API token or a service token (st-<accessKey>-<secretKey>).

Body

application/json
subjectTypeToSubject
object
required

The subject to simulate, as a map from subject type to subject. Use the same subject types as role assignments.

Example:
action
string
required

The action to test, for example query. See Actions.

Example:

"query"

resourceSrn2String
string
required

SRN of the resource to test access to.

Example:

"srn2:cluster#my-cluster:table#myTable"

policyDocumentJson
string

The policy document as a JSON string (escape the inner quotes). See Custom Policy Configuration for the format.

Example:

"{\"version\":\"v1\",\"statements\":[{\"effect\":\"allow\",\"actions\":[\"query\"],\"resources\":[\"srn2:cluster#*:table#myTable\"]}]}"

usePrincipal
boolean
default:true

When true (the default), the caller's own roles are evaluated together with subjectTypeToSubject. Set to false to evaluate only the subjects you pass.

Response

Simulation result.

result
boolean

True if the action would be allowed.

Example:

true

info
string

Names of the policies that were loaded for the evaluation.