Update role enum and access control Remove isRouteAnAPI(route: string):

boolean

Refactor role determination logic to use `eduPersonPrimaryAffiliation`
and `amuComposante`. This simplifies checking for Polytech affiliation
and identifies roles like professor, administration, and student more
accurately. The API access control is updated to reflect the new role
names.
This commit is contained in:
2026-01-07 22:56:06 +01:00
parent c0a335d33f
commit bda47fd88b
2 changed files with 10 additions and 28 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ import { AsyncRoute } from "$fresh/src/server/types.ts";
export interface AuthenticatedState {
isAuthenticated: true;
isFromPolytech: boolean;
role: "etudiants" | "personnels" | "autres";
role: "etudiant" | "professeur" | "administration" | "autre";
session: CasContent;
availablePages: Record<string, string>;
}