Add grant check to FAQ inquiry button
- Add permission check (64, 'R') to onClickToNavigation in FAQ list page - Prevent navigation to QNA list without proper read permission - Show localized permission error message when access is denied 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,7 @@ import { useFaqListMutation } from '@/entities/support/api/use-faq-list-mutation
|
||||
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constant';
|
||||
import { DetailData, FaqItem, FaqListParams, FaqListResponse, SearchCl } from '@/entities/support/model/types';
|
||||
import { SupportFaqItem } from '@/entities/support/ui/faq-item';
|
||||
import {
|
||||
import {
|
||||
useSetHeaderTitle,
|
||||
useSetHeaderType,
|
||||
useSetFooterMode,
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
} from '@/widgets/sub-layout/use-sub-layout';
|
||||
import useIntersectionObserver from '@/widgets/intersection-observer';
|
||||
import { FaqDetail } from '@/entities/support/ui/detail/faq-detail';
|
||||
import { checkGrant } from '@/shared/lib/check-grant';
|
||||
import { showAlert } from '@/widgets/show-alert';
|
||||
|
||||
export const FaqListPage = () => {
|
||||
@@ -137,6 +138,10 @@ export const FaqListPage = () => {
|
||||
};
|
||||
|
||||
const onClickToNavigation = () => {
|
||||
if (!checkGrant(64, 'R')) {
|
||||
showAlert(t('common.nopermission'));
|
||||
return;
|
||||
}
|
||||
navigate(PATHS.support.qna.list);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user