@polargold/pg-frontend-vue
    Preparing search index...

    Interface UseRoutePermissionOptions

    interface UseRoutePermissionOptions {
        getUserRoles: () => string[];
        isAdmin?: () => boolean;
        isAuthUserLoaded: () => boolean;
        notAllowedRouteName: string;
        onNavigationError?: (
            error: unknown,
            to: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric,
        ) => void | Promise<void>;
    }
    Index
    getUserRoles: () => string[]

    Returns the current user's role names. Passed straight through to the internal usePermission.

    isAdmin?: () => boolean

    Returns whether the current user is an admin. Passed straight through to the internal usePermission.

    isAuthUserLoaded: () => boolean

    Returns whether the current user's auth state has finished loading yet. Replaces a direct useAuthUserStore().authUserIsLoaded read - both ama-deep and data-sheet-portal guard the permission check on this; luv-autoq-frontend's copy was missing the guard entirely (a real gap found during the audit, fixed by porting this option as required, not optional).

    notAllowedRouteName: string

    Route name to redirect to when a permission check fails and the route has no customRedirectName.

    onNavigationError?: (
        error: unknown,
        to: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric,
    ) => void | Promise<void>

    Forwarded to the internal useRouterPush - called if the permission-redirect navigation itself fails (e.g. notAllowedRouteName doesn't exist). All three source copies of useRouterPush fell back to a 404/error page here; this package makes that opt-in instead of assuming a specific route registry.