Class RequiresRole.Evaluator
- java.lang.Object
-
- de.codecamp.vaadin.security.spring.access.rules.RequiresRole.Evaluator
-
- All Implemented Interfaces:
AccessEvaluator
- Enclosing class:
- RequiresRole
public static class RequiresRole.Evaluator extends Object implements AccessEvaluator
-
-
Constructor Summary
Constructors Constructor Description Evaluator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasAccess(com.vaadin.flow.router.BeforeEnterEvent beforeEnterEvent, Class<?> targetOrLayout)Returns whether the user should be granted access to the navigation target.
-
-
-
Method Detail
-
hasAccess
public boolean hasAccess(com.vaadin.flow.router.BeforeEnterEvent beforeEnterEvent, Class<?> targetOrLayout)Description copied from interface:AccessEvaluatorReturns whether the user should be granted access to the navigation target. The provided class is either the navigation target itself or one of its parent layouts currently being evaluated.When access is denied, it's allowed to call the forward or reroute methods on the event.
VaadinSecuritycan be very useful in implementations.- Specified by:
hasAccessin interfaceAccessEvaluator- Parameters:
beforeEnterEvent- the attempted navigation to be checked for accesstargetOrLayout- the current target or layout class being evaluated- Returns:
- whether the user should have access to the navigation target
-
-