Tenant Isolation
Multi-tenant data isolation by default.
What it shows
Section titled “What it shows”- Tenant filter on ordinary handlers
- What breaks if you forget tenancy (and how the framework prevents it)
Source
Section titled “Source”Feature entry point: src/feature.ts.
cd samples/recipes/tenant-isolationbun testSource code
Section titled “Source code”The feature entry point — embedded straight from the source file, so the code here is exactly what runs. Multi-file samples keep their remaining files next to it on GitHub (link below):
import { createEntity, createTextField, defineFeature } from "@cosmicdrift/kumiko-framework/engine";
export const noteEntity = createEntity({ table: "read_sample_notes", fields: { title: createTextField({ required: true }), content: createTextField(), },});
const adminWrite = { access: { roles: ["Admin"] } } as const;const openRead = { access: { openToAll: true } } as const;
export const noteFeature = defineFeature("notes", (r) => { r.crud("note", noteEntity, { write: adminWrite, read: openRead, verbs: { update: false, delete: false, restore: false }, });});📄 On GitHub: samples/recipes/tenant-isolation/src/feature.ts