Route-level permission guard: reads route.meta.hasAnyPermission /
hasAllPermissions / excludeRoles / customRedirectName, checks the
initial route on initialize(), and installs a router.beforeEach guard
for subsequent navigation.
Generalizes the copy found in ama-deep/data-sheet-portal (byte-identical
between the two) - replaces their direct useAuthUserStore() import and
hardcoded ROUTE.PUBLIC_PAGE_NOT_ALLOWED with UseRoutePermissionOptions,
and uses this package's own useRouterPush internally for the
permission-redirect (same as the source copies did) - see
onNavigationError to opt into logging/fallback-navigation if that
redirect itself fails.
luv-autoq-frontend's copy is not one of the sources here - it was
missing the isAuthUserLoaded guard the other two have, which is exactly
the drift this consolidation exists to catch. See isAuthUserLoaded in
UseRoutePermissionOptions - it's required, not optional, for that reason.
Route-level permission guard: reads
route.meta.hasAnyPermission/hasAllPermissions/excludeRoles/customRedirectName, checks the initial route oninitialize(), and installs arouter.beforeEachguard for subsequent navigation.Generalizes the copy found in
ama-deep/data-sheet-portal(byte-identical between the two) - replaces their directuseAuthUserStore()import and hardcodedROUTE.PUBLIC_PAGE_NOT_ALLOWEDwithUseRoutePermissionOptions, and uses this package's ownuseRouterPushinternally for the permission-redirect (same as the source copies did) - seeonNavigationErrorto opt into logging/fallback-navigation if that redirect itself fails.luv-autoq-frontend's copy is not one of the sources here - it was missing theisAuthUserLoadedguard the other two have, which is exactly the drift this consolidation exists to catch. SeeisAuthUserLoadedinUseRoutePermissionOptions- it's required, not optional, for that reason.