diff --git a/front/src/app/pages/immersion-assessment/AssessmentPage.tsx b/front/src/app/pages/immersion-assessment/AssessmentPage.tsx index beae10e3f4..c390b5febc 100644 --- a/front/src/app/pages/immersion-assessment/AssessmentPage.tsx +++ b/front/src/app/pages/immersion-assessment/AssessmentPage.tsx @@ -3,7 +3,9 @@ import { Alert } from "@codegouvfr/react-dsfr/Alert"; import React from "react"; import { Loader, MainWrapper, PageHeader } from "react-design-system"; import { + AssessmentRole, ConventionJwtPayload, + assessmentRoles, decodeMagicLinkJwtWithoutSignatureCheck, } from "shared"; import { Breadcrumbs } from "src/app/components/Breadcrumbs"; @@ -31,7 +33,7 @@ export const AssessmentPage = ({ route }: AssessmentPageProps) => { }); const canCreateAssessment = convention?.status === "ACCEPTED_BY_VALIDATOR"; - const hasRight = role === "establishment-tutor"; + const hasRight = assessmentRoles.includes(role as AssessmentRole); if (fetchConventionError) return ( diff --git a/shared/src/role/role.dto.ts b/shared/src/role/role.dto.ts index 10e59092f1..e12125c59c 100644 --- a/shared/src/role/role.dto.ts +++ b/shared/src/role/role.dto.ts @@ -5,6 +5,7 @@ export type SignatoryRole = (typeof allSignatoryRoles)[number]; export type AgencyModifierRole = (typeof agencyModifierRoles)[number]; export type ModifierRole = (typeof allModifierRoles)[number]; export type EstablishmentRole = (typeof establishmentsRoles)[number]; +export type AssessmentRole = (typeof assessmentRoles)[number]; export const allRoles = [ "beneficiary", "beneficiary-representative", @@ -40,6 +41,12 @@ export const allModifierRoles = [ ...agencyModifierRoles, ] as const; +export const assessmentRoles = [ + "establishment-tutor", + "validator", + "counsellor", +] as const; + export const getRequesterRole = (roles: Role[]): Role => { if (roles.includes("back-office")) return "back-office"; if (roles.includes("validator")) return "validator";