From b20e14cd7ee0c1384fe38dbb20ad553c5d03f997 Mon Sep 17 00:00:00 2001 From: Ryan Waskiewicz Date: Wed, 10 Jun 2026 11:48:54 -0400 Subject: [PATCH] fix: ensure only pa-message-admin role can upload csv Update upload component to only show the button to upload a CSV when users have the pa-message-admin role. This should (correctly) fail on the backend already, this is a presentational change only --- .../components/Dashboard/UploadPaMessages.tsx | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/assets/js/components/Dashboard/UploadPaMessages.tsx b/assets/js/components/Dashboard/UploadPaMessages.tsx index 17f6d8b9..23ec3723 100644 --- a/assets/js/components/Dashboard/UploadPaMessages.tsx +++ b/assets/js/components/Dashboard/UploadPaMessages.tsx @@ -6,6 +6,7 @@ import { createNewPaMessage } from "Utils/api"; import { useScreenplayState } from "Hooks/useScreenplayContext"; import { signDirection } from "../../util"; import Toast from "Components/Toast"; +import { isPaMessageAdmin } from "Utils/auth"; const gameDates = [ { @@ -149,14 +150,18 @@ const UploadPaMessages = () => { ))}
- + {!isPaMessageAdmin() ? ( +
You do not have sufficient privileges to upload a file.
+ ) : ( + + )}
setResult(null)} />