Skip to content

Commit a23b9f6

Browse files
committed
Allow super users to approve DREF
1 parent d615a98 commit a23b9f6

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/views/AccountMyFormsDref/ActiveDrefTable/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ function ActiveDrefTable(props: Props) {
245245
applicationType,
246246
canAddOpsUpdate,
247247
canCreateFinalReport,
248-
isUserRegionCoordinator: isRegionCoordinator,
248+
hasPermissionToApprove: isRegionCoordinator || userMe?.is_superuser,
249249
onPublishSuccess: refetchActiveDref,
250250
};
251251
},
@@ -260,6 +260,7 @@ function ActiveDrefTable(props: Props) {
260260
strings.activeDrefTableTypeOfDrefHeading,
261261
strings.activeDrefTableStatusHeading,
262262
latestDrefToOriginalMap,
263+
userMe,
263264
userRegionCoordinatorMap,
264265
refetchActiveDref,
265266
],

src/views/AccountMyFormsDref/DrefTableActions/index.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ import useBooleanState from '#hooks/useBooleanState';
2424
import useTranslation from '#hooks/useTranslation';
2525
import useAlert from '#hooks/useAlert';
2626
import { useLazyRequest } from '#utils/restRequest';
27-
import {
28-
DREF_STATUS_IN_PROGRESS,
29-
} from '#utils/constants';
27+
import { DREF_STATUS_IN_PROGRESS } from '#utils/constants';
3028

3129
import { exportDrefAllocation } from './drefAllocationExport';
3230
import i18n from './i18n.json';
@@ -42,7 +40,7 @@ export interface Props {
4240
applicationType: 'DREF' | 'OPS_UPDATE' | 'FINAL_REPORT';
4341
canAddOpsUpdate: boolean;
4442
canCreateFinalReport: boolean;
45-
isUserRegionCoordinator?: boolean;
43+
hasPermissionToApprove?: boolean;
4644

4745
onPublishSuccess?: () => void;
4846
}
@@ -55,7 +53,7 @@ function DrefTableActions(props: Props) {
5553
applicationType,
5654
canAddOpsUpdate,
5755
canCreateFinalReport,
58-
isUserRegionCoordinator,
56+
hasPermissionToApprove,
5957
onPublishSuccess,
6058
} = props;
6159

@@ -358,7 +356,7 @@ function DrefTableActions(props: Props) {
358356

359357
const canDownloadAllocation = (applicationType === 'DREF' || applicationType === 'OPS_UPDATE');
360358

361-
const canApprove = status === DREF_STATUS_IN_PROGRESS && isUserRegionCoordinator;
359+
const canApprove = status === DREF_STATUS_IN_PROGRESS && hasPermissionToApprove;
362360

363361
const disabled = fetchingDref
364362
|| fetchingOpsUpdate

0 commit comments

Comments
 (0)