Skip to content

Commit

Permalink
fix loading convention when connected as establishment user but not w…
Browse files Browse the repository at this point in the history
…ith an email mentionned in the convention
  • Loading branch information
JeromeBu committed Feb 13, 2025
1 parent e9c403c commit 411d279
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion shared/src/inclusionConnect/inclusionConnect.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ export const getIcUserRoleForAccessingConvention = (
if (user.isBackofficeAdmin) roles.push("back-office");
if (convention.signatories.establishmentRepresentative.email === user.email)
roles.push("establishment-representative");
if (convention.establishmentTutor.email === user.email)
if (
convention.establishmentTutor.email === user.email ||
user.establishments?.some((e) => e.siret === convention.siret)
)
roles.push("establishment-tutor");
const agencyRight = user.agencyRights.find(
(agencyRight) => agencyRight.agency.id === convention.agencyId,
Expand Down

0 comments on commit 411d279

Please sign in to comment.