if (to.fullPath.startsWith('/customers') && currentUserPermissions?.includes(Permission.CUSTOMER_READ))
return true;
if (to.fullPath.startsWith('/sales') && currentUserPermissions?.includes(Permission.SALES_READ))
return true;
// .. more
return abortNavigation(
createError({
statusCode: 403,
message: 'You do not have permissions to access this page.',
}),
);
if (to.fullPath.startsWith('/customers') && currentUserPermissions?.includes(Permission.CUSTOMER_READ))
return true;
if (to.fullPath.startsWith('/sales') && currentUserPermissions?.includes(Permission.SALES_READ))
return true;
// .. more
return abortNavigation(
createError({
statusCode: 403,
message: 'You do not have permissions to access this page.',
}),
);