Checkpoint SHD dashboard design system

This commit is contained in:
JB
2026-07-24 21:31:35 -04:00
commit 5e113454ee
52 changed files with 3128 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
import type { AuthUser } from './session';
import { error } from '@sveltejs/kit';
/**
* Every admin page, action, and endpoint must call this server-side.
* The capability-based permission checks will replace the broad admin role
* as the permission editor is introduced.
*/
export function requireAdmin(user: AuthUser | null): asserts user is AuthUser {
if (!user) error(401, 'Sign in required');
if (user.role !== 'admin') error(403, 'Administrator permission required');
}