Skip to main content

The most recent patch for this version is 1.0.3.  Learn more  

Version: 1.0

When can an investment banker read customer documents?

In this third example we are going to send a POST request to the REST API asking what conditions need to met so that an investment banker can read customer records.

As a user you can send the request in JSON format for the evaluation.

Request

To generate an AST response or a JSON response, send the following request to the /authorization/constraints endpoint.

To generate a Human-readable TEXT response, send this request to the /authorization/simplified-constraints endpoint.

{
"providedAttributes": [
{
"attribute": "abcbank.documentType",
"values": [
"customer_record"
]
},

{
"attribute": "abcbank.action",
"values": [
"read"
]
},
{
"attribute": "abcbank.role",
"values": [
"investment_banker"
]
}
],
"pdpDecisionSet": [
"PERMIT"
],
"excludeIndeterminate": false
}

Responses

You can get 3 distinct response types for the aforementioned request.

AST response

{
"response": {
"apply": {
"function": "or",
"returnType": "boolean",
"arguments": [
{
"apply": {
"function": "and",
"returnType": "boolean",
"arguments": [
{
"apply": {
"function": "anyOfAny",
"returnType": "boolean",
"arguments": [
{
"functionElement": {
"name": "equal",
"returnType": "boolean"
}
},
{
"attributeDesignator": {
"attributeName": "abcbank.name",
"type": "list",
"listOf": "string"
}
},
{
"attributeDesignator": {
"attributeName": "abcbank.documentOwner",
"type": "list",
"listOf": "string"
}
}
]
}
},
{
"apply": {
"function": "anyOf",
"returnType": "boolean",
"arguments": [
{
"functionElement": {
"name": "equal",
"returnType": "boolean"
}
},
{
"constant": {
"value": "remote",
"type": "string"
}
},
{
"attributeDesignator": {
"attributeName": "abcbank.location",
"type": "list",
"listOf": "string"
}
}
]
}
}
]
}
},
{
"apply": {
"function": "anyOf",
"returnType": "boolean",
"arguments": [
{
"functionElement": {
"name": "equal",
"returnType": "boolean"
}
},
{
"constant": {
"value": "office",
"type": "string"
}
},
{
"attributeDesignator": {
"attributeName": "abcbank.location",
"type": "list",
"listOf": "string"
}
}
]
}
}
]
}
}
}