import { NavigationGuardNext, RouteLocationNormalized } from 'vue-router'; export type TransactionRole = { manager: boolean; monitoringReport: boolean; staff: boolean; approver: boolean; }; export type SystemRole = { create: boolean; view: boolean; update: boolean; delete: boolean; }; export type SystemRoleAttribute = 'importData' | 'assetAttribute' | 'assetPolicies' | 'depreciationGroup' | 'depreciationMethod' | 'documentDeletion' | 'group' | 'iotReader' | 'license' | 'purchaseDocument' | 'purchaseInformation' | 'userAndRole' | 'openApi' | 'tag' | 'tagType' | 'registerAsset'; export type TransactionAttribute = 'borrowingRole' | 'assignmentRole' | 'disposalRole' | 'transferRole' | 'auditRole' | 'maintenanceRole' | 'repairRole' | 'trackingRole' | 'damagedRole' | 'registrationRole' | 'missingRole'; export type TransactionType = 'borrowing' | 'assignment' | 'disposal' | 'transfer' | 'audit' | 'maintenance' | 'repair' | 'tracking' | 'damaged' | 'registration' | 'missing'; export interface UserLogin { transactionRoles: Record; systemRoles: Record; userType: 'Admin' | 'Basic'; } declare const getTransactionRole: (name: keyof UserLogin['transactionRoles']) => TransactionRole; declare const getSystemRole: (name: keyof UserLogin['systemRoles']) => SystemRole; declare const hasSystemRole: (name: SystemRoleAttribute) => boolean; declare const hasTransactionRole: (name: TransactionAttribute) => boolean; declare const hasManagerRole: (name: TransactionAttribute) => boolean; declare const hasAnyManagerRole: () => boolean; declare const hasAnyMonitoringReportRole: () => boolean; declare const hasStaffRole: (name: TransactionAttribute) => boolean; declare const hasMonitoringReportRole: (name: TransactionAttribute) => boolean; declare const hasApprovalRole: (name: TransactionAttribute) => boolean; /** * Vue Router navigation guard that checks user access based on the route's metadata * and the user's type retrieved from local storage. * * Access is granted if: * 1. The user is currently logging out (flag checked by `checkLogoutFlag`). * 2. The route's `meta.hasAccess` is true AND the user is an 'Admin'. * 3. The route's `meta.hasAccess` is true AND the route is a special exemption path * ('handover-confirmation' or 'my-profile'). * * If access is denied, navigation is redirected to '/not-found'. * * @param {RouteLocationNormalized} to - The target route location object. * @param {RouteLocationNormalized} from - The current route location object. * @param {NavigationGuardNext} next - The function to call to resolve the hook. * @returns {void} */ declare const checkRouteAccess: (to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext) => void; declare const hasAccessToAssetDetail: () => boolean; export { getTransactionRole, getSystemRole, hasTransactionRole, hasApprovalRole, hasSystemRole, checkRouteAccess, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole, hasAccessToAssetDetail, };