diff --git a/packages/frontend/src/features/upload/UploadImage.tsx b/packages/frontend/src/features/upload/UploadImage.tsx index 14fda70..78b4b25 100644 --- a/packages/frontend/src/features/upload/UploadImage.tsx +++ b/packages/frontend/src/features/upload/UploadImage.tsx @@ -25,6 +25,7 @@ import { createModal } from "@codegouvfr/react-dsfr/Modal"; import { ImageCanvas, Line } from "./DrawingCanvas"; import { api } from "../../api"; import imageCompression from "browser-image-compression"; +import { useUser } from "../../contexts/AuthContext"; const modal = createModal({ id: "edit-picture", @@ -111,6 +112,14 @@ export const UploadImage = ({ reportId }: { reportId: string }) => { return () => broadcastChannel.removeEventListener("message", listener); }, []); + const user = useUser()!; + + // TODO delete this line, this is a temporary test + const canUploadImage = [ + "user-e0960bb7-355e-4194-a8a9-5f059512e282", + "user-607d5ff4-df93-4823-bd94-1626d595ec74", + ].includes(user.id); + return ( <> {