From 4b3efe1378587200e286e762ba91d677b4cf9ae5 Mon Sep 17 00:00:00 2001 From: Aurora Lahtela <24460436+AuroraLS3@users.noreply.github.com> Date: Wed, 18 Oct 2023 19:17:20 +0300 Subject: [PATCH] Check for permission before linking to Query page from Query Modal --- .../dashboard/src/components/modal/QueryPlayerListModal.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Plan/react/dashboard/src/components/modal/QueryPlayerListModal.js b/Plan/react/dashboard/src/components/modal/QueryPlayerListModal.js index d332502be..1ce439781 100644 --- a/Plan/react/dashboard/src/components/modal/QueryPlayerListModal.js +++ b/Plan/react/dashboard/src/components/modal/QueryPlayerListModal.js @@ -7,9 +7,11 @@ import PlayerListCard from "../cards/common/PlayerListCard"; import {getViewTitle} from "../../views/query/QueryResultView"; import {ChartLoader} from "../navigation/Loader"; import {Link} from "react-router-dom"; +import {useAuth} from "../../hooks/authenticationHook"; const QueryPlayerListModal = ({open, toggle, queryData, title}) => { const {t} = useTranslation(); + const {hasPermission} = useAuth(); return ( @@ -23,7 +25,7 @@ const QueryPlayerListModal = ({open, toggle, queryData, title}) => { } - {Boolean(queryData?.data?.players.players.length) && {t('html.query.label.showFullQuery')} }