From b0ec2beb2e868196a4886ba0864fb9f6cde352b9 Mon Sep 17 00:00:00 2001 From: Sagar Naik Date: Wed, 27 Nov 2024 16:56:36 +0530 Subject: [PATCH] fix: analytics filters access check --- src/screens/Analytics/GlobalSearch/GlobalSearchBar.res | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/screens/Analytics/GlobalSearch/GlobalSearchBar.res b/src/screens/Analytics/GlobalSearch/GlobalSearchBar.res index 493533cac..6be146e6d 100644 --- a/src/screens/Analytics/GlobalSearch/GlobalSearchBar.res +++ b/src/screens/Analytics/GlobalSearch/GlobalSearchBar.res @@ -19,6 +19,7 @@ let make = () => { let (categorieSuggestionResponse, setCategorieSuggestionResponse) = React.useState(_ => Dict.make()->JSON.Encode.object ) + let {userHasAccess} = GroupACLHooks.useUserGroupACLHook() let (searchResults, setSearchResults) = React.useState(_ => []) let merchentDetails = HSwitchUtils.useMerchantDetailsValue() let isReconEnabled = merchentDetails.recon_status === Active @@ -148,7 +149,9 @@ let make = () => { }, [showModal]) React.useEffect(() => { - getCategoryOptions()->ignore + if userHasAccess(~groupAccess=AnalyticsView) === Access { + getCategoryOptions()->ignore + } let onKeyPress = event => { let metaKey = event->ReactEvent.Keyboard.metaKey