이용내역 권한 관련
This commit is contained in:
@@ -9,6 +9,7 @@ import { PATHS } from '@/shared/constants/paths';
|
||||
import { useStore } from '@/shared/model/store';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { showAlert } from '@/widgets/show-alert';
|
||||
import { checkGrant } from '@/shared/lib/check-grant';
|
||||
|
||||
export const BoxContainer2 = () => {
|
||||
const { navigate } = useNavigate();
|
||||
@@ -81,17 +82,8 @@ export const BoxContainer2 = () => {
|
||||
callOverview();
|
||||
}, []);
|
||||
|
||||
const checkGrant = (menuId?: number) => {
|
||||
const menuGrantsByKey = useStore.getState().UserStore.menuGrantsByKey;
|
||||
const myGrants = menuGrantsByKey['' + menuId];
|
||||
if(myGrants?.includes('R')){
|
||||
return true
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
const onClickToNavigate = () => {
|
||||
if(checkGrant(36)){
|
||||
if(checkGrant(36, 'R')){
|
||||
navigate(PATHS.settlement.list);
|
||||
}
|
||||
else{
|
||||
|
||||
Reference in New Issue
Block a user