권한 read
This commit is contained in:
@@ -8,6 +8,7 @@ import { useNavigate } from '@/shared/lib/hooks';
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
import { useStore } from '@/shared/model/store';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { showAlert } from '@/widgets/show-alert';
|
||||
|
||||
export const BoxContainer2 = () => {
|
||||
const { navigate } = useNavigate();
|
||||
@@ -80,8 +81,22 @@ 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 = () => {
|
||||
navigate(PATHS.settlement.list);
|
||||
if(checkGrant(36)){
|
||||
navigate(PATHS.settlement.list);
|
||||
}
|
||||
else{
|
||||
showAlert('권한이 없습니다.');
|
||||
}
|
||||
};
|
||||
|
||||
const translateDayOfWeek = (koreanDay: string): string => {
|
||||
|
||||
Reference in New Issue
Block a user