diff --git a/app/src/App/routes/index.tsx b/app/src/App/routes/index.tsx index 9c7a8ccc01..9540ea91b7 100644 --- a/app/src/App/routes/index.tsx +++ b/app/src/App/routes/index.tsx @@ -823,7 +823,7 @@ const allFlashUpdates = customWrapRoute({ context: { title: 'All Flash Updates', visibility: 'is-authenticated', - permissions: ({ isIfrcAdmin, isGuestUser }) => !isGuestUser && isIfrcAdmin, + permissions: ({ isIfrcAdmin }) => isIfrcAdmin, }, }); @@ -838,7 +838,7 @@ const flashUpdateFormNew = customWrapRoute({ context: { title: 'New Flash Update', visibility: 'is-authenticated', - permissions: ({ isIfrcAdmin, isGuestUser }) => !isGuestUser && isIfrcAdmin, + permissions: ({ isIfrcAdmin }) => isIfrcAdmin, }, }); @@ -853,7 +853,7 @@ const flashUpdateFormEdit = customWrapRoute({ context: { title: 'Edit Flash Update', visibility: 'is-authenticated', - permissions: ({ isIfrcAdmin, isGuestUser }) => !isGuestUser && isIfrcAdmin, + permissions: ({ isIfrcAdmin }) => isIfrcAdmin, }, }); @@ -869,7 +869,7 @@ const flashUpdateFormDetails = customWrapRoute({ context: { title: 'Flash Update Details', visibility: 'anything', - permissions: ({ isIfrcAdmin, isGuestUser }) => !isGuestUser && isIfrcAdmin, + permissions: ({ isIfrcAdmin }) => isIfrcAdmin, }, }); @@ -1083,8 +1083,7 @@ const newPerOverviewForm = customWrapRoute({ permissions: ({ isSuperUser, isPerAdmin, - isGuestUser, - }) => !isGuestUser && (isSuperUser || isPerAdmin), + }) => isSuperUser || isPerAdmin, }, }); diff --git a/app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsTable/LocalUnitTableActions/index.tsx b/app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsTable/LocalUnitTableActions/index.tsx index 5782af847c..5f4ece4fe0 100644 --- a/app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsTable/LocalUnitTableActions/index.tsx +++ b/app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsTable/LocalUnitTableActions/index.tsx @@ -37,10 +37,10 @@ function LocalUnitsTableActions(props: Props) { onActionSuccess, } = props; - const { isCountryAdmin, isSuperUser, isGuestUser } = usePermissions(); + const { isCountryAdmin, isSuperUser } = usePermissions(); const strings = useTranslation(i18n); - const hasValidatePermission = !isGuestUser && (isSuperUser || isCountryAdmin(countryId)); + const hasValidatePermission = isSuperUser || isCountryAdmin(countryId); const [readOnlyLocalUnitModal, setReadOnlyLocalUnitModal] = useState(false); diff --git a/app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/index.tsx b/app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/index.tsx index 7c5708c8c2..bdcc77c460 100644 --- a/app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/index.tsx +++ b/app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/index.tsx @@ -111,8 +111,7 @@ function NationalSocietyLocalUnits(props: Props) { const strings = useTranslation(i18n); - const hasAddLocalUnitPermission = !isGuestUser - && (isCountryAdmin(countryResponse?.id) || isSuperUser); + const hasAddLocalUnitPermission = isCountryAdmin(countryResponse?.id) || isSuperUser; useEffect(() => { document.addEventListener('fullscreenchange', handleFullScreenChange); diff --git a/app/src/views/CountryNsOverviewStrategicPriorities/index.tsx b/app/src/views/CountryNsOverviewStrategicPriorities/index.tsx index 089a2e80ff..3ce5575b9a 100644 --- a/app/src/views/CountryNsOverviewStrategicPriorities/index.tsx +++ b/app/src/views/CountryNsOverviewStrategicPriorities/index.tsx @@ -40,15 +40,14 @@ export function Component() { isCountryPerAdmin, isSuperUser, isRegionPerAdmin, - isGuestUser, } = usePermissions(); const countryDetails = useCountry({ id: Number(countryId) }); const regionId = isDefined(countryDetails) ? Number(countryDetails?.region) : undefined; const isPerAdmin = isSuperUser - || (!isGuestUser && isCountryPerAdmin(Number(countryId))) - || (!isGuestUser && isRegionPerAdmin(regionId)); + || isCountryPerAdmin(Number(countryId)) + || isRegionPerAdmin(regionId); const { pending: publicPerStatsPending, diff --git a/app/src/views/CountryPreparedness/index.tsx b/app/src/views/CountryPreparedness/index.tsx index 69985d84bf..91ef05f718 100644 --- a/app/src/views/CountryPreparedness/index.tsx +++ b/app/src/views/CountryPreparedness/index.tsx @@ -13,16 +13,14 @@ export function Component() { isCountryPerAdmin, isSuperUser, isRegionPerAdmin, - isGuestUser, } = usePermissions(); const countryDetails = useCountry({ id: Number(countryId) }); - const hasPermission = !isGuestUser && ( - isSuperUser + const hasPermission = isSuperUser || isCountryPerAdmin(Number(countryId)) - || isRegionPerAdmin(Number(countryDetails?.region)) - ); + || isRegionPerAdmin(Number(countryDetails?.region)); + if (hasPermission) { return (