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 718e7f9d76
commit 229e72da88
2 changed files with 9 additions and 28 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ import { AsyncRoute } from "$fresh/src/server/types.ts";
interface AuthenticatedState {
isAuthenticated: true;
isFromPolytech: boolean;
role: "etudiants" | "personnels" | "autres";
role: "etudiant" | "professeur" | "administration" | "autre";
session: CasContent;
}