Class SecuredViewAccessControl

java.lang.Object
com.vaadin.spring.access.SecuredViewAccessControl
All Implemented Interfaces:
ViewAccessControl, Serializable

@SpringComponent public class SecuredViewAccessControl extends Object implements ViewAccessControl, Serializable
Bean to enable Spring Security support for SpringViewProvider. The bean should be visible for component scan.

If the bean is used, application Views can be protected against unauthorized access with the @Secured annotation.

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    isAccessGranted(com.vaadin.ui.UI ui, String beanName)
    Checks the explicitly given bean of View class for granted access for the current user
    boolean
    isAccessGranted(Class<? extends com.vaadin.navigator.View> viewClass)
    Checks the explicitly given View class for granted access for the current user
    protected boolean
    isAccessGranted(String[] securityConfigAttributes)
    Checks if the current user is granted any explicitly provided security attributes (usually set with @Secured annotation).
    protected boolean
    isAccessGranted(org.springframework.security.access.annotation.Secured viewSecured)
    Checks the explicitly given view annotation for granted access for the current user

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SecuredViewAccessControl

      public SecuredViewAccessControl()
  • Method Details

    • isAccessGranted

      protected boolean isAccessGranted(String[] securityConfigAttributes)
      Checks if the current user is granted any explicitly provided security attributes (usually set with @Secured annotation).
      Parameters:
      securityConfigAttributes - list of security configuration attributes (e.g. ROLE_USER, ROLE_ADMIN).
      Returns:
      true if the access is granted or the view is not secured, false otherwise
      See Also:
      • Secured
    • isAccessGranted

      public boolean isAccessGranted(com.vaadin.ui.UI ui, String beanName)
      Checks the explicitly given bean of View class for granted access for the current user
      Specified by:
      isAccessGranted in interface ViewAccessControl
      Parameters:
      ui - current UI
      beanName - view bean name
      Returns:
      true if the access is granted or the view is not secured, false otherwise
      See Also:
      • Secured
    • isAccessGranted

      public boolean isAccessGranted(Class<? extends com.vaadin.navigator.View> viewClass)
      Checks the explicitly given View class for granted access for the current user
      Parameters:
      viewClass - view class
      Returns:
      true if the access is granted or the view is not secured, false otherwise
      See Also:
      • Secured
    • isAccessGranted

      protected boolean isAccessGranted(org.springframework.security.access.annotation.Secured viewSecured)
      Checks the explicitly given view annotation for granted access for the current user
      Parameters:
      viewSecured - annotation instance detected on a View
      Returns:
      true if the access is granted or the view is not secured, false otherwise