Add permission checks and localization improvements
- Add grant check (64, 'X') to QNA register page - Add grant check (45, 'X') to user login auth modification - Replace hardcoded Korean permission messages with i18n key 'common.nopermission' - Add 'nopermission' translation key to both en.json and ko.json - Update .env.development to use development API endpoints 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
VITE_APP_ENV=development
|
VITE_APP_ENV=development
|
||||||
#VITE_APP_AUTH_PROXY_HOST='http://3.35.79.250:8090'
|
VITE_APP_AUTH_PROXY_HOST='http://3.35.79.250:8090'
|
||||||
#VITE_APP_API_PROXY_HOST='http://3.35.79.250:8080'
|
VITE_APP_API_PROXY_HOST='http://3.35.79.250:8080'
|
||||||
VITE_APP_AUTH_PROXY_HOST='https://auth.nicepay.co.kr'
|
# VITE_APP_AUTH_PROXY_HOST='https://auth.nicepay.co.kr'
|
||||||
VITE_APP_API_PROXY_HOST='https://rest.nicepay.co.kr'
|
# VITE_APP_API_PROXY_HOST='https://rest.nicepay.co.kr'
|
||||||
GENERATE_SOURCEMAP=false
|
GENERATE_SOURCEMAP=false
|
||||||
SENTRY_AUTH_TOKEN=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
|
SENTRY_AUTH_TOKEN=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
|
||||||
@@ -7,6 +7,8 @@ import { useUserModifyAuthMethodMutation } from '@/entities/user/api/use-user-mo
|
|||||||
import { PATHS } from '@/shared/constants/paths';
|
import { PATHS } from '@/shared/constants/paths';
|
||||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||||
import { snackBar } from '@/shared/lib/toast';
|
import { snackBar } from '@/shared/lib/toast';
|
||||||
|
import { checkGrant } from '@/shared/lib/check-grant';
|
||||||
|
import { showAlert } from '@/widgets/show-alert';
|
||||||
|
|
||||||
export const UserLoginAuthInfoWrap = ({
|
export const UserLoginAuthInfoWrap = ({
|
||||||
mid,
|
mid,
|
||||||
@@ -287,6 +289,11 @@ export const UserLoginAuthInfoWrap = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleSave = async () => {
|
const handleSave = async () => {
|
||||||
|
if(!checkGrant(45, 'X')){
|
||||||
|
showAlert(t('common.nopermission'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const addMethods: AuthMethodModifyItem[] = [];
|
const addMethods: AuthMethodModifyItem[] = [];
|
||||||
const removeMethods: AuthMethodModifyItem[] = [];
|
const removeMethods: AuthMethodModifyItem[] = [];
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export const BoxContainer1 = () => {
|
|||||||
navigate(PATHS.settlement.list);
|
navigate(PATHS.settlement.list);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
showAlert('권한이 없습니다.');
|
showAlert(t('common.nopermission'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ export const BoxContainer2 = () => {
|
|||||||
navigate(PATHS.settlement.list);
|
navigate(PATHS.settlement.list);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
showAlert('권한이 없습니다.');
|
showAlert(t('common.nopermission'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ export const FavoriteWrapper = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
showAlert('권한이 없습니다.');
|
showAlert(t('common.nopermission'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export const HomeNoticeItem = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
showAlert('권한이 없습니다.');
|
showAlert(t('common.nopermission'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export const MenuCategory = ({
|
|||||||
itemIndex
|
itemIndex
|
||||||
}: MenuCategoryProps) => {
|
}: MenuCategoryProps) => {
|
||||||
const { navigate } = useNavigate();
|
const { navigate } = useNavigate();
|
||||||
const { i18n } = useTranslation();
|
const { t, i18n } = useTranslation();
|
||||||
|
|
||||||
const [favoriteItems, setFavoriteItems] = useState<Array<UserFavorite>>([]);
|
const [favoriteItems, setFavoriteItems] = useState<Array<UserFavorite>>([]);
|
||||||
const [menuIds, setMenuIds] = useState<Array<number | undefined>>([]);
|
const [menuIds, setMenuIds] = useState<Array<number | undefined>>([]);
|
||||||
@@ -47,7 +47,7 @@ export const MenuCategory = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
showAlert('권한이 없습니다.');
|
showAlert(t('common.nopermission'));
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -367,7 +367,7 @@ export const ListWrap = ({
|
|||||||
setEmailBottomSheetOn(true);
|
setEmailBottomSheetOn(true);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
showAlert('권한이 없습니다.');
|
showAlert(t('common.nopermission'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ export const AllTransactionDetail = ({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
showAlert('권한이 없습니다.');
|
showAlert(t('common.nopermission'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ export const CashReceiptDetail = ({
|
|||||||
setBottomSheetOn(true);
|
setBottomSheetOn(true);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
showAlert('권한이 없습니다.');
|
showAlert(t('common.nopermission'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ export const EscrowDetail = ({
|
|||||||
setBottomSheetOn(true);
|
setBottomSheetOn(true);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
showAlert('권한이 없습니다.');
|
showAlert(t('common.nopermission'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ export const ListWrap = () => {
|
|||||||
setEmailBottomSheetOn(true);
|
setEmailBottomSheetOn(true);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
showAlert('권한이 없습니다.');
|
showAlert(t('common.nopermission'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const onRequestDownloadExcel = (userEmail?: string) => {
|
const onRequestDownloadExcel = (userEmail?: string) => {
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export const ReferenceWrap = () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
showAlert('권한이 없습니다.');
|
showAlert(t('common.nopermission'));
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
"error": "An error occurred",
|
"error": "An error occurred",
|
||||||
"success": "Success",
|
"success": "Success",
|
||||||
"noData": "No data available",
|
"noData": "No data available",
|
||||||
|
"nopermission": "No permission",
|
||||||
"next": "Next",
|
"next": "Next",
|
||||||
"latest": "Latest",
|
"latest": "Latest",
|
||||||
"oldest": "Oldest",
|
"oldest": "Oldest",
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
"error": "오류가 발생했습니다",
|
"error": "오류가 발생했습니다",
|
||||||
"success": "성공",
|
"success": "성공",
|
||||||
"noData": "데이터가 없습니다",
|
"noData": "데이터가 없습니다",
|
||||||
|
"nopermission": "권한이 없습니다",
|
||||||
"next": "다음",
|
"next": "다음",
|
||||||
"latest": "최신순",
|
"latest": "최신순",
|
||||||
"oldest": "오래된순",
|
"oldest": "오래된순",
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ export const QnaListPage = () => {
|
|||||||
navigate(PATHS.support.qna.register);
|
navigate(PATHS.support.qna.register);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
showAlert('권한이 없습니다.');
|
showAlert(t('common.nopermission'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { PATHS } from '@/shared/constants/paths';
|
|||||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||||
import { useQnaSaveMutation } from '@/entities/support/api/use-qna-save-mutation';
|
import { useQnaSaveMutation } from '@/entities/support/api/use-qna-save-mutation';
|
||||||
import { HeaderType } from '@/entities/common/model/types';
|
import { HeaderType } from '@/entities/common/model/types';
|
||||||
import {
|
import {
|
||||||
useSetHeaderTitle,
|
useSetHeaderTitle,
|
||||||
useSetHeaderType,
|
useSetHeaderType,
|
||||||
useSetFooterMode,
|
useSetFooterMode,
|
||||||
@@ -15,6 +15,7 @@ import { PatternFormat } from 'react-number-format';
|
|||||||
import { overlay } from 'overlay-kit';
|
import { overlay } from 'overlay-kit';
|
||||||
import { Dialog } from '@/shared/ui/dialogs/dialog';
|
import { Dialog } from '@/shared/ui/dialogs/dialog';
|
||||||
import { QnaSaveParams, QnaSaveResponse } from '@/entities/support/model/types';
|
import { QnaSaveParams, QnaSaveResponse } from '@/entities/support/model/types';
|
||||||
|
import { checkGrant } from '@/shared/lib/check-grant';
|
||||||
|
|
||||||
export enum QnaRegisterPropsName {
|
export enum QnaRegisterPropsName {
|
||||||
Mid = 'Mid',
|
Mid = 'Mid',
|
||||||
@@ -142,6 +143,10 @@ export const QnaRegisterPage = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onClickToRegisterQna = () => {
|
const onClickToRegisterQna = () => {
|
||||||
|
if (!checkGrant(64, 'X')) {
|
||||||
|
showAlert(t('common.noPermission'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
callRegister();
|
callRegister();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ export const AllTransactionListPage = () => {
|
|||||||
setEmailBottomSheetOn(true);
|
setEmailBottomSheetOn(true);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
showAlert('권한이 없습니다.');
|
showAlert(t('common.nopermission'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const onRequestDownloadExcel = (userEmail?: string) => {
|
const onRequestDownloadExcel = (userEmail?: string) => {
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ export const BillingListPage = () => {
|
|||||||
setDownloadBottomSheetOn(true);
|
setDownloadBottomSheetOn(true);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
showAlert('권한이 없습니다.');
|
showAlert(t('common.nopermission'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const onClickToSort = (sort: SortTypeKeys) => {
|
const onClickToSort = (sort: SortTypeKeys) => {
|
||||||
@@ -167,7 +167,7 @@ export const BillingListPage = () => {
|
|||||||
navigate(PATHS.transaction.billing.charge);
|
navigate(PATHS.transaction.billing.charge);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
showAlert('권한이 없습니다.');
|
showAlert(t('common.nopermission'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ export const CashReceiptListPage = () => {
|
|||||||
setEmailBottomSheetOn(true);
|
setEmailBottomSheetOn(true);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
showAlert('권한이 없습니다.');
|
showAlert(t('common.nopermission'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const onClickToSort = (sort: SortTypeKeys) => {
|
const onClickToSort = (sort: SortTypeKeys) => {
|
||||||
@@ -197,7 +197,7 @@ export const CashReceiptListPage = () => {
|
|||||||
navigate(PATHS.transaction.cashReceipt.handWrittenIssuance);
|
navigate(PATHS.transaction.cashReceipt.handWrittenIssuance);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
showAlert('권한이 없습니다.');
|
showAlert(t('common.nopermission'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ export const EscrowListPage = () => {
|
|||||||
setEmailBottomSheetOn(true);
|
setEmailBottomSheetOn(true);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
showAlert('권한이 없습니다.');
|
showAlert(t('common.nopermission'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const onRequestDownloadExcel = (userEmail?: string) => {
|
const onRequestDownloadExcel = (userEmail?: string) => {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export const FooterNavigation = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
showAlert('권한이 없습니다.');
|
showAlert(t('common.nopermission'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const onClickToOpenMenu = () => {
|
const onClickToOpenMenu = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user