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:
@@ -7,6 +7,8 @@ import { useUserModifyAuthMethodMutation } from '@/entities/user/api/use-user-mo
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { snackBar } from '@/shared/lib/toast';
|
||||
import { checkGrant } from '@/shared/lib/check-grant';
|
||||
import { showAlert } from '@/widgets/show-alert';
|
||||
|
||||
export const UserLoginAuthInfoWrap = ({
|
||||
mid,
|
||||
@@ -287,6 +289,11 @@ export const UserLoginAuthInfoWrap = ({
|
||||
};
|
||||
|
||||
const handleSave = async () => {
|
||||
if(!checkGrant(45, 'X')){
|
||||
showAlert(t('common.nopermission'));
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const addMethods: AuthMethodModifyItem[] = [];
|
||||
const removeMethods: AuthMethodModifyItem[] = [];
|
||||
|
||||
@@ -63,7 +63,7 @@ export const BoxContainer1 = () => {
|
||||
navigate(PATHS.settlement.list);
|
||||
}
|
||||
else{
|
||||
showAlert('권한이 없습니다.');
|
||||
showAlert(t('common.nopermission'));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ export const BoxContainer2 = () => {
|
||||
navigate(PATHS.settlement.list);
|
||||
}
|
||||
else{
|
||||
showAlert('권한이 없습니다.');
|
||||
showAlert(t('common.nopermission'));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ export const FavoriteWrapper = ({
|
||||
}
|
||||
}
|
||||
else{
|
||||
showAlert('권한이 없습니다.');
|
||||
showAlert(t('common.nopermission'));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ export const HomeNoticeItem = ({
|
||||
}
|
||||
}
|
||||
else{
|
||||
showAlert('권한이 없습니다.');
|
||||
showAlert(t('common.nopermission'));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ export const MenuCategory = ({
|
||||
itemIndex
|
||||
}: MenuCategoryProps) => {
|
||||
const { navigate } = useNavigate();
|
||||
const { i18n } = useTranslation();
|
||||
const { t, i18n } = useTranslation();
|
||||
|
||||
const [favoriteItems, setFavoriteItems] = useState<Array<UserFavorite>>([]);
|
||||
const [menuIds, setMenuIds] = useState<Array<number | undefined>>([]);
|
||||
@@ -47,7 +47,7 @@ export const MenuCategory = ({
|
||||
}
|
||||
}
|
||||
else{
|
||||
showAlert('권한이 없습니다.');
|
||||
showAlert(t('common.nopermission'));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -367,7 +367,7 @@ export const ListWrap = ({
|
||||
setEmailBottomSheetOn(true);
|
||||
}
|
||||
else{
|
||||
showAlert('권한이 없습니다.');
|
||||
showAlert(t('common.nopermission'));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ export const AllTransactionDetail = ({
|
||||
});
|
||||
}
|
||||
else{
|
||||
showAlert('권한이 없습니다.');
|
||||
showAlert(t('common.nopermission'));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ export const CashReceiptDetail = ({
|
||||
setBottomSheetOn(true);
|
||||
}
|
||||
else{
|
||||
showAlert('권한이 없습니다.');
|
||||
showAlert(t('common.nopermission'));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ export const EscrowDetail = ({
|
||||
setBottomSheetOn(true);
|
||||
}
|
||||
else{
|
||||
showAlert('권한이 없습니다.');
|
||||
showAlert(t('common.nopermission'));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ export const ListWrap = () => {
|
||||
setEmailBottomSheetOn(true);
|
||||
}
|
||||
else{
|
||||
showAlert('권한이 없습니다.');
|
||||
showAlert(t('common.nopermission'));
|
||||
}
|
||||
};
|
||||
const onRequestDownloadExcel = (userEmail?: string) => {
|
||||
|
||||
@@ -51,7 +51,7 @@ export const ReferenceWrap = () => {
|
||||
});
|
||||
}
|
||||
else{
|
||||
showAlert('권한이 없습니다.');
|
||||
showAlert(t('common.nopermission'));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user