Policies
Policies are a way of authorizing requests to your Architect API. A Policy consists of multiple Policy Items that can be combined together to form complex access rules.
#
Creating policy itemsPolicy Items can be created by sending a POST
request to /api/todos/policy_items
, authenticated with your developer key.
Let's say we wanted to limit updating our TODOs to only admins that are assigned to it. The body of the request would look something like this:
Creating additional Policy Items results in them being aggregated using OR
operation, while all of the items defined under the data
array of the one Policy Item are aggregated using AND
.
#
Updating policy itemsUpdating Policy Items works in a similar way. Just send a PUT
request to /api/todos/policy_items/:id
with the same format of the JSON body.
#
Listing all policy itemsYou can fetch all created Policy Items by sending a GET
request to /api/todos/policy_items
.