Fine-grained authorization is available on the Business plan and above. Reading and the check keep working after a move to a lower plan, and so does removing things.
The model
- Types of part form a tree, for example
region→branch. Each type has a key your apps use (fixed once made), a name and one parent type. The top type sits under your organization. You can have up to 20 types, at most 4 levels deep. - Roles for parts are made for one type, for example
branch_approveron eachbranch. A role for parts carries your app permissions only, never Aiveth powers, so it never makes anyone an admin. Its key must differ from your whole-organization role keys. You can have up to 100. - Parts are the actual regions, branches or projects. Each has your own id (
external_id, 1 to 128 characters), a name, and a parent part of the parent type. An organization can have up to 50,000 parts. - Access gives a role for parts on one part to a person or a group. A group’s access reaches every member, including people who join later.
Set it up in the console
1
Add types
Go to Parts & access and choose Type. Start at the top, like region, then add the types under it, like branch.
2
Add roles for parts
Choose Role, pick the type it applies to, and tick the app permissions it carries, like
claim:approve.3
Add parts
Choose Part, or let your app register parts as it makes them (below).
4
Give access
Open a part and give a role on it to a person or a group.
The check
Your server asks: may this person do this permission on this part? The answer is yes when either:- the person’s whole-organization role carries the permission (what their token already says), or
- the person, or a group they are in, holds a role for parts carrying the permission on this part or any part above it.
via:
kind is organization_role (with role) or resource_role. group appears only when the access came through a group. via is null when allowed is false.
Admin API
Your server calls the admin API with an API key in theAuthorization: Bearer aiveth_sk_... header. Each endpoint needs one of these key powers:
Register a part
Give access
Examples
resourcesFor, accessOf, find, get, peopleWith, change, remove and take. See Node SDK.
Rules
- Nobody gives access to themselves, or to a group they are in, unless they are an Owner. An API key never gives access to its maker.
- A group that holds roles on parts hands them to anyone who joins, so changing its members needs Manage roles, and each change is recorded.
- A part can move only to a new parent of the parent type. Removing a part is refused while parts sit under it, unless you pass
everything_below=true. - Nothing is removed while something stands on it: a type with parts, child types or roles; a role anyone holds; a group that holds roles on parts.
- Lists of parts return at most 500 at a time.
- Every change is recorded in the activity log and sends a webhook.