1
0
Fork 0
fahrPool/web/lib/plattform/superadmin.ts

9 lines
437 B
TypeScript

import type { ProfileResult } from "@/lib/auth/profile";
// Die Plattform-Actions arbeiten ausschliesslich mit dem Service-Client (der
// Superadmin hat keine RLS-Policies auf Fachdaten). Diese Pruefung ist deshalb
// die einzige Schranke und steht am Anfang jeder Plattform-Action und -Seite.
export function pruefeSuperadmin(profil: ProfileResult): boolean {
return profil.status === "ok" && profil.profile.role === "superadmin";
}