From a225d5111933703d12434c4685980169f7a9c02d Mon Sep 17 00:00:00 2001 From: Jay Sheen Date: Wed, 5 Nov 2025 18:28:56 +0900 Subject: [PATCH] Add permission checks to payout pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add grant check (53, 'D') to payout list download button - Add grant check (53, 'X') to payout request button - Add grant check (53, 'D') to payout detail certificate download button - Refactor inline onClick handlers to method references Changes: - payout/list-page: Add permission checks for download and request actions - payout/detail-page: Add permission check for certificate download 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../additional-service/payout/detail-page.tsx | 6 ++++++ src/pages/additional-service/payout/list-page.tsx | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/pages/additional-service/payout/detail-page.tsx b/src/pages/additional-service/payout/detail-page.tsx index 795424a..e458ddd 100644 --- a/src/pages/additional-service/payout/detail-page.tsx +++ b/src/pages/additional-service/payout/detail-page.tsx @@ -17,6 +17,8 @@ import { useExtensionPayoutDetailDownloadCertificateMutation } from '@/entities/ import moment from 'moment'; import { EmailBottomSheet } from '@/entities/common/ui/email-bottom-sheet'; import { DownloadTypeBottomSheet } from '@/entities/common/ui/download-type-bottom-sheet'; +import { checkGrant } from '@/shared/lib/check-grant'; +import { showAlert } from '@/widgets/show-alert'; export const PayoutDetailPage = () => { const { t, i18n } = useTranslation(); @@ -52,6 +54,10 @@ export const PayoutDetailPage = () => { }); const onClickToDownload = () => { + if (!checkGrant(53, 'D')) { + showAlert(t('common.nopermission')); + return; + } setDownloadTypeBottomSheetOn(true); }; diff --git a/src/pages/additional-service/payout/list-page.tsx b/src/pages/additional-service/payout/list-page.tsx index c194b83..5c06eba 100644 --- a/src/pages/additional-service/payout/list-page.tsx +++ b/src/pages/additional-service/payout/list-page.tsx @@ -34,6 +34,8 @@ import { useExtensionAccessCheck } from '@/shared/lib/hooks/use-extension-access import useIntersectionObserver from '@/widgets/intersection-observer'; import { PayoutList } from '@/entities/additional-service/ui/payout/payout-list'; import { PayoutDetail } from '@/entities/additional-service/ui/payout/detail/payout-detail'; +import { checkGrant } from '@/shared/lib/check-grant'; +import { showAlert } from '@/widgets/show-alert'; export const PayoutListPage = () => { // Access check @@ -88,6 +90,10 @@ export const PayoutListPage = () => { }); const onClickToNavigation = () => { + if (!checkGrant(53, 'X')) { + showAlert(t('common.nopermission')); + return; + } navigate(PATHS.additionalService.payout.request); }; @@ -144,6 +150,10 @@ export const PayoutListPage = () => { }; const onClickToOpenEmailBottomSheet = () => { + if (!checkGrant(53, 'D')) { + showAlert(t('common.nopermission')); + return; + } setEmailBottomSheetOn(true); }; @@ -273,7 +283,7 @@ export const PayoutListPage = () => {