Interface AccessDecision

All Known Implementing Classes:
AccessDecision.Granted, AccessDecision.Reroute, AccessDecision.RerouteToError, AccessDecision.RerouteWithParameter, AccessDecision.RerouteWithParameters

Vaadin-free result of an authorization-phase evaluation.

This type only describes the intended navigation result. Vaadin-specific translation is handled by the adapter module.

  • Method Details

    • granted

      static AccessDecision granted()
      Creates a AccessDecision.Granted decision.
      Returns:
      access granted
    • reroute

      static AccessDecision reroute(String target, boolean asForward)
      Creates a AccessDecision.Reroute decision with a redirect target.
      Parameters:
      target - the route to redirect to
      asForward - true for forward, false for reroute
      Returns:
      access denied with redirect
    • denied

      static AccessDecision denied(String alternativeRoute, boolean asForward)
      Compatibility factory for route denial.
      Parameters:
      alternativeRoute - the route to redirect to
      asForward - true for forward, false for reroute
      Returns:
      access denied with redirect
    • reroute

      static AccessDecision reroute(String target)
      Creates a reroute decision.
      Parameters:
      target - the target route
      Returns:
      reroute decision
    • forward

      static AccessDecision forward(String target)
      Creates a forward decision.
      Parameters:
      target - the target route
      Returns:
      forward decision
    • rerouteToError

      static AccessDecision rerouteToError(Class<? extends Exception> type, String message)
      Creates a AccessDecision.RerouteToError decision that reroutes to an error page.
      Parameters:
      type - the exception class for the error page
      message - optional message (may be null)
      Returns:
      access denied with error
    • deniedWithError

      static AccessDecision deniedWithError(Class<? extends Exception> type, String message)
      Compatibility factory for error denial.
      Parameters:
      type - the exception class for the error page
      message - optional message (may be null)
      Returns:
      access denied with error