Interface AccessDecision
- All Known Implementing Classes:
AccessDecision.Granted, AccessDecision.Reroute, AccessDecision.RerouteToError, AccessDecision.RerouteWithParameter, AccessDecision.RerouteWithParameters
public sealed interface AccessDecision
permits AccessDecision.Granted, AccessDecision.RerouteToError, AccessDecision.Reroute, AccessDecision.RerouteWithParameter<T>, AccessDecision.RerouteWithParameters<T>
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.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordAccess is granted.static final recordAccess is denied and should redirect to a target route.static final recordAccess is denied and should reroute to an error page.static final recordAccess is denied and should reroute with one route parameter.static final recordAccess is denied and should reroute with multiple route parameters. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic AccessDecisionCompatibility factory for route denial.static AccessDecisiondeniedWithError(Class<? extends Exception> type, String message) Compatibility factory for error denial.static AccessDecisionCreates a forward decision.static AccessDecisiongranted()Creates aAccessDecision.Granteddecision.static AccessDecisionCreates a reroute decision.static AccessDecisionCreates aAccessDecision.Reroutedecision with a redirect target.static AccessDecisionrerouteToError(Class<? extends Exception> type, String message) Creates aAccessDecision.RerouteToErrordecision that reroutes to an error page.
-
Method Details
-
granted
-
reroute
Creates aAccessDecision.Reroutedecision with a redirect target.- Parameters:
target- the route to redirect toasForward-truefor forward,falsefor reroute- Returns:
- access denied with redirect
-
denied
Compatibility factory for route denial.- Parameters:
alternativeRoute- the route to redirect toasForward-truefor forward,falsefor reroute- Returns:
- access denied with redirect
-
reroute
Creates a reroute decision.- Parameters:
target- the target route- Returns:
- reroute decision
-
forward
Creates a forward decision.- Parameters:
target- the target route- Returns:
- forward decision
-
rerouteToError
Creates aAccessDecision.RerouteToErrordecision that reroutes to an error page.- Parameters:
type- the exception class for the error pagemessage- optional message (may benull)- Returns:
- access denied with error
-
deniedWithError
Compatibility factory for error denial.- Parameters:
type- the exception class for the error pagemessage- optional message (may benull)- Returns:
- access denied with error
-