Package com.vaadin.flow.server.auth
Class AccessCheckResult
java.lang.Object
com.vaadin.flow.server.auth.AccessCheckResult
- All Implemented Interfaces:
Serializable
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 AccessCheckResultallow()Create a result instance informing that the navigation to the target view is allowed for the current user.static AccessCheckResultcreate(AccessCheckDecision decision, String reason) Create a result instance for the provided decision and reason.decision()Gets the navigation access checker decision.static AccessCheckResultCreate a result instance informing that the navigation to the target view is denied for the current user.booleaninthashCode()static AccessCheckResultneutral()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 AccessCheckResultCreate 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.
Thereasoncannot be null forAccessCheckDecision.DENYandAccessCheckDecision.REJECT. ForAccessCheckDecision.ALLOWthe 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.ALLOWresult instance.
-
neutral
Create a result instance informing that the checker cannot take a decision based on the given navigation information.- Returns:
- a
AccessCheckDecision.NEUTRALresult 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.DENYresult 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.REJECTresult instance.
-