mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 23:21:08 +02:00
Adds the client-side scope primitives that sit between module code and Dexie so every query is filtered by the user's active Space: lib/data/scope/ ├── active-space.svelte.ts reactive active-space state; loads via │ Better Auth's organization/get-active-member │ and auto-activates personal on first boot ├── bootstrap.ts reconcileSentinels() — rewrites every │ `_personal:<userId>` placeholder from the │ v28 migration to the real space id once │ Better Auth responds ├── scoped-db.ts scopedTable / scopedForModule — filter- │ based scope enforcement. assertModuleAllowed │ blocks disallowed modules per space-type │ (e.g. mood in a brand space) ├── visibility.ts applyVisibility / isVisibleToCurrentUser — │ hides private records not authored by the │ current user, even inside a shared space └── index.ts barrel export for consumers Wrap accepts sentinel spaceId alongside the real id during the bootstrap window so records written between v28 landing and the first reconcile don't vanish from the UI. No module uses this yet — the calendar pilot migration in the next commit is the first consumer and validates the whole model. 10/10 unit tests pass. The fetch- and Dexie-backed functions (loadActiveSpace, reconcileSentinels, scopedTable) are integration-only and covered as the pilot migration lands. Plan: docs/plans/spaces-foundation.md Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| api | ||
| calc/packages/shared | ||
| calendar | ||
| cards | ||
| chat | ||
| citycorners | ||
| contacts | ||
| context | ||
| docs | ||
| food | ||
| guides | ||
| inventory | ||
| mana | ||
| manavoxel | ||
| memoro | ||
| moodlit | ||
| mukke | ||
| news | ||
| photos | ||
| picture | ||
| plants | ||
| presi | ||
| questions | ||
| quotes/packages/content | ||
| skilltree | ||
| storage | ||
| times | ||
| todo | ||
| traces | ||
| uload | ||