Add permission checks to additional service pages
- Add grant check (54, 'D') to link payment download buttons - Add grant check (54, 'X') to link payment request buttons - Add grant check (65, 'D') to face auth download button - Add grant check (60, 'D') to account holder search download button - Add grant check (60, 'X') to account holder search request button - Refactor inline onClick handlers to method references Changes: - link-payment-history-wrap: Add permission checks for download and request - link-payment-wait-send-wrap: Add permission checks for download and request - face-auth-page: Add permission check for download - account-holder-search-page: Add permission check for download - account-holder-search-list: Add permission check for search request 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,8 @@ import { useExtensionAccessCheck } from '@/shared/lib/hooks/use-extension-access
|
||||
import useIntersectionObserver from '@/widgets/intersection-observer';
|
||||
import { snackBar } from '@/shared/lib';
|
||||
import { AccountHolderSearchDetail } from '@/entities/additional-service/ui/account-holder-search/detail/account-holder-search-detail';
|
||||
import { checkGrant } from '@/shared/lib/check-grant';
|
||||
import { showAlert } from '@/widgets/show-alert';
|
||||
|
||||
export const AccountHolderSearchPage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
@@ -139,6 +141,10 @@ export const AccountHolderSearchPage = () => {
|
||||
};
|
||||
|
||||
const onClickToOpenEmailBottomSheet = () => {
|
||||
if (!checkGrant(60, 'D')) {
|
||||
showAlert(t('common.nopermission'));
|
||||
return;
|
||||
}
|
||||
setEmailBottomSheetOn(true);
|
||||
};
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@ import { ListDateGroup } from '@/entities/additional-service/ui/list-date-group'
|
||||
import { useExtensionAccessCheck } from '@/shared/lib/hooks/use-extension-access-check';
|
||||
import useIntersectionObserver from '@/widgets/intersection-observer';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { checkGrant } from '@/shared/lib/check-grant';
|
||||
import { showAlert } from '@/widgets/show-alert';
|
||||
|
||||
export const FaceAuthPage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
@@ -126,6 +128,10 @@ export const FaceAuthPage = () => {
|
||||
};
|
||||
|
||||
const onClickToOpenEmailBottomSheet = () => {
|
||||
if (!checkGrant(65, 'D')) {
|
||||
showAlert(t('common.nopermission'));
|
||||
return;
|
||||
}
|
||||
setEmailBottomSheetOn(true);
|
||||
};
|
||||
|
||||
@@ -244,7 +250,7 @@ export const FaceAuthPage = () => {
|
||||
<button
|
||||
className="download-btn"
|
||||
aria-label={t('transaction.download')}
|
||||
onClick={() => onClickToOpenEmailBottomSheet()}
|
||||
onClick={onClickToOpenEmailBottomSheet}
|
||||
>
|
||||
<img
|
||||
src={IMAGE_ROOT + '/ico_download.svg'}
|
||||
|
||||
Reference in New Issue
Block a user