이용내역 권한 관련
This commit is contained in:
@@ -10,6 +10,7 @@ import { useAppBridge } from '@/hooks';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useStore } from '@/shared/model/store';
|
||||
import { showAlert } from '../show-alert';
|
||||
import { checkGrant } from '@/shared/lib/check-grant';
|
||||
|
||||
export const FooterNavigation = ({
|
||||
setMenuOn,
|
||||
@@ -18,20 +19,11 @@ export const FooterNavigation = ({
|
||||
}: FooterProps) => {
|
||||
const { navigate } = useNavigate();
|
||||
const { t } = useTranslation();
|
||||
const menuGrantsByKey = useStore.getState().UserStore.menuGrantsByKey;
|
||||
|
||||
|
||||
const [isFooterOn, setIsFooterOn] = useState<boolean>(true);
|
||||
|
||||
const checkGrant = (menuId?: number) => {
|
||||
const myGrants = menuGrantsByKey['' + menuId];
|
||||
if(myGrants?.includes('R') || menuId === -1){
|
||||
return true
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
const onClickToNavigate = (menuId?: number, path?: string) => {
|
||||
if(menuId && checkGrant(menuId)){
|
||||
if(menuId && checkGrant(menuId, 'R')){
|
||||
if(!!path){
|
||||
navigate(path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user