Add configurable role⊥permission (five tables, gate permissions, register, /_rbac desk), multi-tenant path/header resolution with JSON tenant_scope, and route_ws on_message/presence/dynamic room_key — with author surfaces, demos, and smokes. Co-authored-by: Cursor <cursoragent@cursor.com>
674 B
674 B
ext/web multi-tenant (path / subdomain / header)
| 状态 | Accepted · MVP |
| 日期 | 2026-09-17 |
| 相关 | ext-web-rbac.md · full-ambition plan |
Author API
**应用 = > `应用`.tenant mode="path" param="t" column="tenant_id" default_scope=False**
JSON route table may set tenant_scope / 租户作用域 = true so GET /api/items?t=acme only returns rows with tenant_id=acme.
Runtime
withTenantresolves id into request context.- Scoped JSON selects
AND tenant_id=?; missing tenant → 400. default_scope=Truealso stamps form POST bodies.
Demo: examples/web-tenant-saas/.