com.vaadin.flow.spring.
Class SpringViewAccessChecker
All Implemented Interfaces:
A Spring specific view access checker that falls back to Spring mechanisms when the generic mechanisms do not work.
See Also:
-
Field Summary
Fields inherited from class com.vaadin.flow.server.auth.ViewAccessChecker
SESSION_STORED_REDIRECT, SESSION_STORED_REDIRECT_ABSOLUTE
-
Constructor Summary
ConstructorsConstructorDescriptionSpringViewAccessChecker
(AccessAnnotationChecker accessAnnotationChecker) Creates an instance with the given annotation checker.
-
Method Summary
Modifier and TypeMethodDescriptionprotected Principal
getPrincipal
(VaadinRequest request) Gets the principal for the currently logged in user.
getRolesChecker
(VaadinRequest request) Gets a function for checking roles for the currently logged in user.
Methods inherited from class com.vaadin.flow.server.auth.ViewAccessChecker
beforeEnter, enable, setLoginView, setLoginView
-
Constructor Details
-
SpringViewAccessChecker
Creates an instance with the given annotation checker. The created instance is disabled by default.
Parameters:
accessAnnotationChecker
- the annotation checker to use
-
-
Method Details
-
getPrincipal
Description copied from class:
ViewAccessChecker
Gets the principal for the currently logged in user.
Overrides:
getPrincipal
in classViewAccessChecker
Parameters:
request
- the current request ornull
if no request is in progress (e.g. in a background thread)Returns:
a representation of the currently logged in user or
null
if no user is currently logged in -
getRolesChecker
Description copied from class:
ViewAccessChecker
Gets a function for checking roles for the currently logged in user.
Overrides:
getRolesChecker
in classViewAccessChecker
Parameters:
request
- the current request ornull
if no request is in progress (e.g. in a background thread)Returns:
a function which takes a role name and returns
true
if the user is included in that role
-