Add permission checks to additional service pages

- Add grant check (54, 'D') to link payment download buttons
- Add grant check (54, 'X') to link payment request buttons
- Add grant check (65, 'D') to face auth download button
- Add grant check (60, 'D') to account holder search download button
- Add grant check (60, 'X') to account holder search request button
- Refactor inline onClick handlers to method references

Changes:
- link-payment-history-wrap: Add permission checks for download and request
- link-payment-wait-send-wrap: Add permission checks for download and request
- face-auth-page: Add permission check for download
- account-holder-search-page: Add permission check for download
- account-holder-search-list: Add permission check for search request

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jay Sheen
2025-11-05 18:45:23 +09:00
parent a225d51119
commit 320f213319
5 changed files with 44 additions and 6 deletions

View File

@@ -17,6 +17,8 @@ import { EmailBottomSheet } from '@/entities/common/ui/email-bottom-sheet';
import useIntersectionObserver from '@/widgets/intersection-observer';
import { useTranslation } from 'react-i18next';
import { LinkPaymentHistoryDetail } from './detail/link-payment-history-detail';
import { checkGrant } from '@/shared/lib/check-grant';
import { showAlert } from '@/widgets/show-alert';
const getPaymentResultBtnGroup = (t: any) => [
{ name: t('additionalService.linkPayment.all'), value: LinkPaymentPaymentStatus.ALL },
@@ -76,6 +78,10 @@ export const LinkPaymentHistoryWrap = () => {
});
const onClickToNavigate = () => {
if (!checkGrant(54, 'X')) {
showAlert(t('common.nopermission'));
return;
}
navigate(PATHS.additionalService.linkPayment.request)
};
@@ -133,6 +139,10 @@ export const LinkPaymentHistoryWrap = () => {
};
const onClickToOpenEmailBottomSheet = () => {
if (!checkGrant(54, 'D')) {
showAlert(t('common.nopermission'));
return;
}
setEmailBottomSheetOn(true);
};
@@ -219,7 +229,7 @@ export const LinkPaymentHistoryWrap = () => {
<button
className="download-btn"
aria-label={t('common.download')}
onClick={() => onClickToOpenEmailBottomSheet()}
onClick={onClickToOpenEmailBottomSheet}
>
<img
src={IMAGE_ROOT + '/ico_download.svg'}
@@ -259,7 +269,7 @@ export const LinkPaymentHistoryWrap = () => {
<div className="apply-row">
<button
className="btn-50 btn-blue flex-1"
onClick={() => onClickToNavigate()}
onClick={onClickToNavigate}
>{t('additionalService.linkPayment.applyRequest')}</button>
</div>
<LinkPaymentHistoryFilter