Package com.vaadin.spring.access
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 -
Method Summary
Modifier and TypeMethodDescriptionbooleanisAccessGranted(com.vaadin.ui.UI ui, String beanName) Checks the explicitly given bean ofViewclass for granted access for the current userbooleanisAccessGranted(Class<? extends com.vaadin.navigator.View> viewClass) Checks the explicitly givenViewclass for granted access for the current userprotected booleanisAccessGranted(String[] securityConfigAttributes) Checks if the current user is granted any explicitly provided security attributes (usually set with@Securedannotation).protected booleanisAccessGranted(org.springframework.security.access.annotation.Secured viewSecured) Checks the explicitly given view annotation for granted access for the current user
-
Constructor Details
-
SecuredViewAccessControl
public SecuredViewAccessControl()
-
-
Method Details
-
isAccessGranted
Checks if the current user is granted any explicitly provided security attributes (usually set with@Securedannotation).- Parameters:
securityConfigAttributes- list of security configuration attributes (e.g. ROLE_USER, ROLE_ADMIN).- Returns:
trueif the access is granted or the view is not secured,falseotherwise- See Also:
-
Secured
-
isAccessGranted
Checks the explicitly given bean ofViewclass for granted access for the current user- Specified by:
isAccessGrantedin interfaceViewAccessControl- Parameters:
ui- current UIbeanName- view bean name- Returns:
trueif the access is granted or the view is not secured,falseotherwise- See Also:
-
Secured
-
isAccessGranted
Checks the explicitly givenViewclass for granted access for the current user- Parameters:
viewClass- view class- Returns:
trueif the access is granted or the view is not secured,falseotherwise- 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 aView- Returns:
trueif the access is granted or the view is not secured,falseotherwise
-