com.vaadin.flow.spring.

Class SpringViewAccessChecker

java.lang.Object
com.vaadin.flow.server.auth.ViewAccessChecker
com.vaadin.flow.spring.SpringViewAccessChecker

All Implemented Interfaces:

BeforeEnterListener, BeforeEnterHandler, Serializable

@Deprecated(forRemoval=true, since="24.3") public class SpringViewAccessChecker extends ViewAccessChecker
Deprecated, for removal: This API element is subject to removal in a future version.
ViewAccessChecker has been replaced by NavigationAccessControl.

A Spring specific view access checker that falls back to Spring mechanisms when the generic mechanisms do not work.

See Also:

  • Constructor Details

    • SpringViewAccessChecker

      public SpringViewAccessChecker(AccessAnnotationChecker accessAnnotationChecker)
      Deprecated, for removal: This API element is subject to removal in a future version.

      Creates an instance with the given annotation checker. The created instance is disabled by default.

      Parameters:

      accessAnnotationChecker - the annotation checker to use

      See Also:

  • Method Details

    • getPrincipal

      protected Principal getPrincipal(VaadinRequest request)
      Deprecated, for removal: This API element is subject to removal in a future version.

      Description copied from class: ViewAccessChecker

      Gets the principal for the currently logged in user.

      Overrides:

      getPrincipal in class ViewAccessChecker

      Parameters:

      request - the current request or null 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

      protected Function<String,Boolean> getRolesChecker(VaadinRequest request)
      Deprecated, for removal: This API element is subject to removal in a future version.

      Description copied from class: ViewAccessChecker

      Gets a function for checking roles for the currently logged in user.

      Overrides:

      getRolesChecker in class ViewAccessChecker

      Parameters:

      request - the current request or null 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