Service Layer high complexity mobile
0
Dependencies
0
Dependents
24
Entities
0
Integrations

Description

GoRouter redirect hook that enforces role-based access on every protected route. Each route declares its required role and permission set; the guard checks the active role via the Role Authorization Service and redirects unauthorized users to the No-Access Screen or login as appropriate. Prevents direct deep-link access to restricted routes.

Feature: Role-Based Access Control

permission-guard

Responsibilities

  • Intercept GoRouter navigation and evaluate required permissions per route
  • Redirect unauthenticated users to login
  • Redirect unauthorized users to the No-Access Screen
  • Allow navigation to proceed for authorized users

Interfaces

redirect(context, state)
isAuthenticated()
isAuthorized(requiredRole)
getRedirectPath(reason)