From d5c89010b50cc42d5855bc9df6a0c2d78f63a308 Mon Sep 17 00:00:00 2001 From: Adrian Andersen Date: Fri, 23 Aug 2024 12:15:07 +0200 Subject: [PATCH] fix(RapidHandout): require employee perm to view page --- src/components/RapidHandout.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/RapidHandout.tsx b/src/components/RapidHandout.tsx index e6f32f6..53afb41 100644 --- a/src/components/RapidHandout.tsx +++ b/src/components/RapidHandout.tsx @@ -3,7 +3,7 @@ import { UserDetail } from "@boklisten/bl-model"; import { Alert, Button } from "@mui/material"; import { useState } from "react"; -import { isLoggedIn } from "@/api/auth"; +import { isEmployee, isLoggedIn } from "@/api/auth"; import DynamicLink from "@/components/DynamicLink"; import RapidHandoutDetails from "@/components/RapidHandoutDetails"; import UserDetailSearchField from "@/components/search/UserDetailSearchField"; @@ -13,7 +13,7 @@ export default function RapidHandout() { const hydrated = useIsHydrated(); const [customer, setCustomer] = useState(null); - return hydrated && isLoggedIn() ? ( + return hydrated && isLoggedIn() && isEmployee() ? ( <> { @@ -25,7 +25,7 @@ export default function RapidHandout() { ) : ( <> - Du må logge inn som administrator for å bruke denne siden. + Du må ha ansattilgang for å bruke denne siden.