forked from EduCraft/curriculum-project-hub
12628c9233
- scaffold hub/database-admin as SvelteKit 2 + Svelte 5 static SPA
with aurora/glass visual style (paths.base='/database')
- add lib/{api,session,org}.ts + Aurora.svelte component
- add routes: root redirect, /admin login page, /dashboard (OWNER/ADMIN only)
- backend: replace server-rendered HTML routes with /database/config JSON endpoint
- add hub/src/database/static.ts to serve SPA under /database/*
- wire registerDatabaseSpa into plugin.ts
- exempt /database/* from silo rate-limit (same treatment as /admin/*)
- add database:dev + database:build npm scripts; update deploy scripts
- update hub/src/database/README.md
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
8 lines
247 B
TypeScript
8 lines
247 B
TypeScript
import type { OrgMembership } from './api';
|
|
|
|
export function isOrgAdmin(org: OrgMembership | null | undefined): boolean {
|
|
if (!org) return false;
|
|
const role = String(org.role ?? '').toUpperCase();
|
|
return role === 'OWNER' || role === 'ADMIN';
|
|
}
|