Add permission checks to SMS payment pages
- Add grant check (57, 'D') to SMS payment download button - Add grant check (57, 'X') to SMS resend button - Refactor onClick handlers for better code organization Changes: - sms-payment-page: Add permission check for download, move onClick to button - sms-payment-detail-resend: Add imports for permission check functions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,8 @@ import { SmsPaymentDetailResendProps } from '../../../additional-service/model/s
|
||||
import { useExtensionSmsResendMutation } from '../../api/sms-payment/use-extension-sms-resend-mutation';
|
||||
import appBridge from '@/shared/lib/appBridge';
|
||||
import { snackBar } from '@/shared/lib';
|
||||
import { checkGrant } from '@/shared/lib/check-grant';
|
||||
import { showAlert } from '@/widgets/show-alert';
|
||||
|
||||
export const SmsPaymentDetailResend = ({
|
||||
bottomSmsPaymentDetailResendOn,
|
||||
@@ -22,6 +24,10 @@ export const SmsPaymentDetailResend = ({
|
||||
const {mutateAsync : resendMessage } = useExtensionSmsResendMutation();
|
||||
|
||||
const onClickResend = () => {
|
||||
if (!checkGrant(57, 'X')) {
|
||||
showAlert(t('common.nopermission'));
|
||||
return;
|
||||
}
|
||||
// sendMessage가 없으면 재발송 불가
|
||||
if (!smsDetailData?.sendMessage) {
|
||||
return;
|
||||
|
||||
@@ -25,6 +25,8 @@ import { EmailBottomSheet } from '@/entities/common/ui/email-bottom-sheet';
|
||||
import { useExtensionAccessCheck } from '@/shared/lib/hooks/use-extension-access-check';
|
||||
import useIntersectionObserver from '@/widgets/intersection-observer';
|
||||
import { set } from 'lodash-es';
|
||||
import { checkGrant } from '@/shared/lib/check-grant';
|
||||
import { showAlert } from '@/widgets/show-alert';
|
||||
|
||||
export const SmsPaymentPage = () => {
|
||||
const { t } = useTranslation();
|
||||
@@ -135,6 +137,10 @@ export const SmsPaymentPage = () => {
|
||||
}
|
||||
|
||||
const onClickToOpenEmailBottomSheet = () => {
|
||||
if (!checkGrant(57, 'D')) {
|
||||
showAlert(t('common.nopermission'));
|
||||
return;
|
||||
}
|
||||
setEmailBottomSheetOn(true);
|
||||
};
|
||||
|
||||
@@ -209,11 +215,11 @@ export const SmsPaymentPage = () => {
|
||||
<button
|
||||
className="download-btn"
|
||||
aria-label="다운로드"
|
||||
onClick={onClickToOpenEmailBottomSheet}
|
||||
>
|
||||
<img
|
||||
src={IMAGE_ROOT + '/ico_download.svg'}
|
||||
alt="다운로드"
|
||||
onClick={() => onClickToOpenEmailBottomSheet()}
|
||||
/>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user