com.vaadin.flow.spring.security.

Class SpringMenuAccessControl

java.lang.Object
com.vaadin.flow.server.auth.DefaultMenuAccessControl
com.vaadin.flow.spring.security.SpringMenuAccessControl

All Implemented Interfaces:

MenuAccessControl, Serializable

public class SpringMenuAccessControl extends DefaultMenuAccessControl

A Spring specific menu access control that falls back to Spring mechanisms for view access checking, when the generic mechanisms do not work.

In Spring Boot application, a SpringMenuAccessControl is provided by default, if Spring Security is available.

See Also:

  • Constructor Details

    • SpringMenuAccessControl

      public SpringMenuAccessControl()
  • Method Details

    • canAccessView

      public boolean canAccessView(AvailableViewInfo viewInfo)

      Description copied from interface: MenuAccessControl

      Determines if current user has permissions to access the given view.

      It checks view against authentication state: - If view does not require login -> allow - If not authenticated and login required -> deny. - If user doesn't have correct roles -> deny.

      Parameters:

      viewInfo - view info

      Returns:

      true if the view is accessible, false if something is not authenticated.