Docs · Torii
Organisations and roles
An organisation is the boundary around your data. A role decides what a person or a token may do inside it. They are two separate mechanisms, and the first one does not depend on the second.
Organisations
Everything in Torii belongs to exactly one organisation: every repository, host, cloud account, domain, token, finding and audit entry. An organisation has a name, a short slug, a plan, and the limits that come with the plan.
| Field | Meaning |
|---|---|
| Name and slug | How the organisation is shown and addressed. |
| Plan | The plan the organisation is on. |
| Repository limit | How many repositories the plan allows. Not enforced yet. |
| Host limit | How many hosts the plan allows. Not enforced yet. |
| Seat limit | How many people the plan allows as members. Not enforced yet. |
| Retention | How many days findings are meant to be kept. Nothing deletes findings on this schedule yet. |
You can see these in the console under Settings, in the Organisation card, or read them from the API:
curl -sS "$TORII_CONTROL_PLANE_URL/v1/organisation" \ -H "Authorization: Bearer $TORII_API_TOKEN"
How organisations are kept apart
Separation is enforced by the database, not by the application. Every table that holds customer data carries a Postgres row-level security policy, and every request runs inside a transaction pinned to one organisation. The queries that read your assets carry no organisation filter of their own. A query that forgot one would return nothing, because the database has already decided which rows exist for that request.
Two consequences are visible from the outside:
- Asking for something that belongs to another organisation gets the same
404as asking for something that never existed. The response gives no hint which it was. - The service refuses to start if the database role it connects with would be able to bypass those policies.
A test harness exercises every API route with one organisation's credentials against another organisation's data, and runs on every change. A route that has no such test fails the build.
One organisation per sign-in
A person can belong to more than one organisation, but a signed-in session belongs to exactly one. When you sign in, Torii uses the organisation you joined first. The console at torii.minatolabs.com serves a single organisation, and a session for any other organisation is refused there. The console shows what that refusal looks like.
Roles
There are five roles. Each one is a fixed bundle of permissions, and every API route names the permission it needs.
| Role | API value | Intended for |
|---|---|---|
| Owner | owner | Billing, deletion and ownership. |
| Admin | admin | Everything except changing billing and deleting the organisation. |
| Security | security | Triage, dismissal and policy. The role that runs the product day to day. |
| Developer | developer | Sees findings, may dismiss them on their own repositories, cannot change policy. |
| Read-only | readonly | Reads. Nothing else. |
What each role may do
| Owner | Admin | Security | Developer | Read-only | |
|---|---|---|---|---|---|
| See assets | yes | yes | yes | yes | yes |
| Add assets and enrol hosts | yes | yes | yes | — | — |
| Remove assets | yes | yes | — | — | — |
| See findings | yes | yes | yes | yes | yes |
| Dismiss any finding | yes | yes | yes | — | — |
| Dismiss findings on their own repositories | — | — | — | yes | — |
| See policy | yes | yes | yes | yes | yes |
| Change policy | yes | yes | yes | — | — |
| See scans | yes | yes | yes | yes | yes |
| Start a scan | yes | yes | yes | yes | — |
| See members | yes | yes | yes | yes | yes |
| Invite, change role, remove members | yes | yes | — | — | — |
| Create API tokens and enrolment tokens | yes | yes | yes | yes | — |
| Revoke tokens | yes | yes | yes | — | — |
| List every token in the organisation | yes | yes | — | — | — |
| Read the audit log | yes | yes | yes | — | — |
| Export | yes | yes | yes | yes | yes |
| See billing | yes | yes | — | — | — |
| Change billing | yes | — | — | — | — |
| Delete the organisation | yes | — | — | — | — |
The roles are not a strict ladder. Security may change policy and Developer may not, while Developer has a dismissal permission that Security does not need. That is why Torii compares permissions, not role names, when it decides whether one role may act for another.
When a role is not enough
A request your role does not allow is answered with 403 and the name of the missing permission, and the refusal is written to the audit log:
{ "error": "forbidden", "required": "AssetsDelete" }This is different from the 404 above on purpose. You are a member of this organisation and already know the route exists, so Torii tells you what is missing. It never tells you anything about an organisation you do not belong to.
Your role in the console
The console talks to the API with a credential of its own and passes your signed-in session along with every request. The API then allows only what both your role and the console's credential allow. It can narrow what you may do, never widen it: a read-only member stays read-only in the console, and nobody can do through the console what the console's credential cannot. Actions you take in the console are recorded in the audit log as yours.
The console also hides some controls your role cannot use, such as Create token for a read-only member. Others are shown to everyone and refused when you use them; the message says your role does not allow it.
Your role is read from your membership on every request, so if minatolabs changes it, the API applies the change straight away and the console within about 30 seconds. You do not need to sign in again.
Plans and limits
Plans are designed to price scale and never visibility. The part of Torii that checks plan limits knows four things it can count: repositories, hosts, cloud accounts and seats. It has no limit for findings, at any plan, so a plan can never hide one of your own findings from you.
Workspaces
An organisation can contain workspaces, and an API token may be tied to one. The API lists them at /v1/workspaces and can remove one. There is no way to create a workspace, so for now treat the organisation as the only boundary.