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:
@@ -15,6 +15,7 @@ import {
|
|||||||
} from '@/widgets/sub-layout/use-sub-layout';
|
} from '@/widgets/sub-layout/use-sub-layout';
|
||||||
import useIntersectionObserver from '@/widgets/intersection-observer';
|
import useIntersectionObserver from '@/widgets/intersection-observer';
|
||||||
import { FaqDetail } from '@/entities/support/ui/detail/faq-detail';
|
import { FaqDetail } from '@/entities/support/ui/detail/faq-detail';
|
||||||
|
import { checkGrant } from '@/shared/lib/check-grant';
|
||||||
import { showAlert } from '@/widgets/show-alert';
|
import { showAlert } from '@/widgets/show-alert';
|
||||||
|
|
||||||
export const FaqListPage = () => {
|
export const FaqListPage = () => {
|
||||||
@@ -137,6 +138,10 @@ export const FaqListPage = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onClickToNavigation = () => {
|
const onClickToNavigation = () => {
|
||||||
|
if (!checkGrant(64, 'R')) {
|
||||||
|
showAlert(t('common.nopermission'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
navigate(PATHS.support.qna.list);
|
navigate(PATHS.support.qna.list);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user