com.vaadin.flow.server.auth.
Class AccessCheckResult
All Implemented Interfaces:
A representation of the access check result, potentially providing deny reason.
See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAccessCheckResult
(AccessCheckDecision decision, String reason) Creates a new result.
-
Method Summary
Modifier and TypeMethodDescriptionstatic AccessCheckResult
allow()
Create a result instance informing that the navigation to the target view is allowed for the current user.
static AccessCheckResult
create
(AccessCheckDecision decision, String reason) Create a result instance for the provided decision and reason.
decision()
Gets the navigation access checker decision.
static AccessCheckResult
Create a result instance informing that the navigation to the target view is denied for the current user.
boolean
int
hashCode()
static AccessCheckResult
neutral()
Create a result instance informing that the checker cannot take a decision based on the given navigation information.
reason()
Gets the reason for the navigation access checker decision.
static AccessCheckResult
Create a result instance informing that the navigation to the target view is denied for the current user because of a misconfiguration or a critical development time error.
toString()
-
Constructor Details
-
AccessCheckResult
Creates a new result.
Parameters:
decision
- the access checker decision.reason
- a message explaining the reason for that decision.
-
-
Method Details
-
decision
Gets the navigation access checker decision.
Returns:
the navigation access checker decision, never null.
-
reason
Gets the reason for the navigation access checker decision.
May be null for allow and neutral decisions.
Returns:
the reason for the navigation access checker decision.
-
equals
-
hashCode
public int hashCode() -
toString
-
create
Create a result instance for the provided decision and reason.
reason
cannot be null forAccessCheckDecision.DENY
andAccessCheckDecision.REJECT
. ForAccessCheckDecision.ALLOW
the reason is ignored.Parameters:
decision
- the decision for this result, never null.reason
- a message explaining why the current decision has been taken. Useful for debugging purposes.Returns:
a result instance for given decision and reason.
-
allow
Create a result instance informing that the navigation to the target view is allowed for the current user.
Returns:
a
AccessCheckDecision.ALLOW
result instance. -
neutral
Create a result instance informing that the checker cannot take a decision based on the given navigation information.
Returns:
a
AccessCheckDecision.NEUTRAL
result instance. -
deny
Create a result instance informing that the navigation to the target view is denied for the current user.
Parameters:
reason
- a message explaining why the navigation has been denied. Useful for debugging purposes.Returns:
a
AccessCheckDecision.DENY
result instance. -
reject
Create a result instance informing that the navigation to the target view is denied for the current user because of a misconfiguration or a critical development time error.
Parameters:
reason
- a message explaining why the navigation has been denied and the critical issue encountered. Useful for debugging purposes.Returns:
a
AccessCheckDecision.REJECT
result instance.
-