Conduit
Conduit
Docsllms.txtHostingGitHubIntroduction

Getting Started

OverviewInstall ConduitMCP SetupYour First AppStart with AI

Learn

ArchitectureClient vs Admin APIConfiguration

Modules

OverviewAuthenticationAuthorizationDatabaseStorageCommunicationsChatRouterFunctions

Guides

Next.js IntegrationReBAC Team ScopingGitOps State Export

Deployment

Deployment OverviewDocker ComposeKubernetes and HelmLocal from SourceContainer Images

Reference

CLI ReferenceClient APIAdmin APIEnvironment VariablesMCP Tools

Resources

Migration v0.16 → v0.17Legacy DocumentationChangelogFAQGlossaryContributing

Authorization

ReBAC resources, relations, permissions, and scope.

The authorization module implements relationship-based access control (ReBAC, Zanzibar-style). Subjects (users, teams) link to resources via relations; permissions resolve from those relations with optional inheritance (owner->read).

Use cases

Multi-tenant B2B

Team-owned records — documents belong to a Team, not just a user

Document sharing

Grant editor/viewer relations without duplicating ownership logic

Scoped creates

New records inherit team context via the scope query param

Runtime permission checks

Ask can this user edit this resource? before showing UI actions

Capabilities

  • Resource definitions
  • Relation tuples
  • Permission inheritance (->)
  • scope on creates
  • /authorization/check
  • Built-in Team resource
  • Authorized schema integration

Example: Team-owned documents with scope

Walkthrough

  1. Enable authorization on the Document schema (conduitOptions.authorization.enabled)
  2. Ensure the user has edit permission on Team:abc (team member or owner)
  3. Create a document with scope=Team:abc as a query parameter
  4. Before PATCH, call GET /authorization/check?action=edit&resource=Document:docId
Create with scope
curl -X POST "http://localhost:3000/database/Document?scope=Team:507f1f77bcf86cd799439011" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"title":"Q1 roadmap","body":"Team-owned doc"}'
Check permission
curl "http://localhost:3000/authorization/check?action=edit&resource=Document:DOC_ID" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

How it works

Mental model

ResourceDefinition "Document"
  relations: owner -> [User, Team], editor -> [User, Team]
  permissions: read -> [editor, owner, owner->read], edit -> [editor, owner]

Tuple: Team:abc#owner@Document:xyz
Check: can(User:uid, edit, Document:xyz) -> true via team inheritance

Three layers (do not confuse)

LayerControls
Document ReBACPer-document read/edit/delete on authorized schemas
Schema CMS permissionsWho can use Admin Panel CRUD on a schema
Route middlewareHTTP route authentication flags on custom endpoints

This page covers document ReBAC.

Ownership on create

When scope=Team:tid is set on POST /database/{Schema}:

  1. Pre-check: user must have edit on the scope resource
  2. Tuple created: Team:tid#owner@{Schema}:{docId} — not a direct User owner tuple

When scope is omitted, the authenticated user becomes User:uid#owner@{Schema}:{docId}.

Inheritance (->)

owner->read means: subject has owner on this resource, and the owner subject type (e.g. Team) defines a read permission that team members inherit.

Built-in Team resource

Authentication registers Team with relations member, owner, readAll, editAll and permissions read, edit, delete, invite, manageMembers, etc. Use these action names — do not invent new ones without extending the definition.

Configure

  1. Enable authorization module in deployment
  2. Set conduitOptions.authorization.enabled: true on schemas via MCP patch_database_schemas_id
  3. Define custom resources with POST /authorization/resources or MCP equivalent
  4. Grant tuples with POST /authorization/relations

Client API

OperationPath
Permission checkGET /authorization/check?action=edit&resource=Document:id&scope=Team:tid
Roles on resourceGET /authorization/role/:resource?scope=Team:tid

Always pass scope on database creates when using team-owned records.

MCP

Enable ?modules=authorization.

ToolPurpose
get_authorization_resourcesList resource definitions
post_authorization_resourcesDefine resources, relations, permissions
post_authorization_relationsCreate relationship tuples
get_authorization_permissions_canAdmin-side permission check (permission, subject, resource)

Next steps

  • ReBAC team scoping guide
  • Database module
  • Authentication & teams
  • Client vs Admin API

Authentication

Users, local/OAuth login, tokens, teams, 2FA, and sudo for sensitive operations.

Database

Schemas, CRUD, custom endpoints, indexes, query trees, and GitOps export.

On this page

Use casesCapabilitiesExample: Team-owned documents with scopeHow it worksMental modelThree layers (do not confuse)Ownership on createInheritance (->)Built-in Team resourceConfigureClient APIMCP