Skip to content

RBAC & Security Design 🟑 BETA

Read where role checks happen in code and confirm the same rules apply to organizations, bots, apps and knowledge-base folders.

Admin guide Β· RBAC design verification runbook

When to use Before you start Steps Verify Roll back
Reviewing a permission model, adding a data app Source checkout, test tenants Find the tables, the resolver and the checks One resolver, no client-supplied scope Revert the change through version control

When to use

Use this runbook before adding a new protected surface, or when two apps appear to enforce the same role differently.

Before you start

  • The security matrix is the map of code-level controls; the RBAC overview explains the vocabulary; configuration applies it.
  • Organization membership, bot ownership, app access and KB folder permissions are separate scopes. One does not imply another.
  • Object storage keys carry the verified owner; a search filter alone is not an authorisation boundary.
  • No internal IP addresses belong in configuration or documentation; use hostnames and environment variables.

Steps

# 1. Find the RBAC tables and the single role resolver.
grep -RIn "rbac_\|resolve_user_role" botserver/src botserver/crates \
  --include='*.rs' | head -40

# 2. Confirm the tenant predicate on a representative CRUD handler.
grep -RIn "branch_id\|org_id" botserver/src/main_module/routes --include='*.rs' | head -30

# 3. Confirm KB search filters use the verified owner.
grep -RIn "permissions\|index_visibility" botserver/crates/botcore/src/kb --include='*.rs' | head -20

# 4. Probe two test tenants against the same app.

Verify

Scope Evidence Pass condition
Organization membership query one verified owner per workspace
Bot bots row bot belongs to the expected branch
KB folder parser resolution hidden folder absent from search
App handler predicate scope applied on read and write
Object storage key prefix verified owner in the key
Audit server log decisions recorded

Roll back

πŸ”΄ Revert the source change and redeploy with the deploy runbook. A broken scope is an incident under incident response.