mirror of
https://github.com/saltbo/zpan.git
synced 2026-08-30 17:50:07 +08:00
a1510906fb
Enable org-aware architecture: auto-create personal org on signup, first user promoted to admin (race-safe atomic SQL), requireAdmin middleware, org context resolution in auth middleware. - Add organization, member, invitation tables to auth schema - Add admin plugin fields (role, banned, banReason, banExpires) to user - Add session fields (impersonatedBy, activeOrganizationId) - Rename storage_quotas → org_quotas, matters.uid → matters.org_id - Add findPersonalOrg service with SQL-level metadata filtering - Widen Database type to include both app and auth schemas - Include auth schema in Cloudflare platform adapter - Update shared types for org-aware API (OrgQuota, Organization, Member) - Add DB migration 0001_org_and_admin_plugins - Add tests for admin role, org creation, requireAdmin, findPersonalOrg - Fix pre-existing shared package typecheck (add typescript devDep) Agent-Profile: https://agent-kanban.dev/agents/a6bb038c4226a87f Co-authored-by: Bob <aibob@mails.agent-kanban.dev>