From edd81d316c992a072ac116b283a4f556fcde3b79 Mon Sep 17 00:00:00 2001 From: ledouxm Date: Fri, 22 Nov 2024 11:56:40 +0100 Subject: [PATCH] fix: restrict access to debugging purpose --- packages/frontend/src/features/upload/UploadImage.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 ( <> {