public abstract class AbstractVaadinSecurity extends Object implements ApplicationContextAware, InitializingBean, VaadinSecurity
VaadinSecurity| Constructor and Description |
|---|
AbstractVaadinSecurity() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
AccessDecisionManager |
getAccessDecisionManager()
Returns the
AccessDecisionManager or null if not available. |
ApplicationContext |
getApplicationContext()
Returns the current Spring application context (never
null). |
AuthenticationManager |
getAuthenticationManager()
Returns the
AuthenticationManager or null if not
available. |
RememberMeServices |
getRememberMeServices()
Returns the
RememberMeServices or an instance of
NullRememberMeServices if not available. |
boolean |
hasAccessDecisionManager()
Checks if an
AccessDecisionManager is available or not. |
boolean |
hasAccessToObject(Object securedObject,
String... securityConfigurationAttributes)
Checks if the current user is authorized based on the specified security configuration attributes.
|
boolean |
hasAccessToSecuredMethod(Object securedObject,
String methodName,
Class<?>... methodParameterTypes)
Uses the
Secured annotation on the specified method to
check if the current user has access to the secured object. |
boolean |
hasAccessToSecuredObject(Object securedObject)
Convenience method that invokes
VaadinSecurity.hasAccessToObject(Object, String...), using the
Secured annotation of the secured object
to get the security configuration attributes. |
boolean |
hasAnyAuthority(String... authorities)
Checks if the current user has at least one of the specified authorities.
|
boolean |
hasAuthenticationManager()
Checks if an
AuthenticationManager is available or not. |
boolean |
hasAuthorities(String... authorities)
Checks if the current user has all required authorities.
|
boolean |
hasAuthority(String authority)
Checks if the current user has the specified authority.
|
boolean |
isAuthenticated()
Returns true if the current user is authenticated and not anonymous.
|
boolean |
isAuthenticatedAnonymously()
Returns true if the current user is authenticated and anonymous.
|
boolean |
isFullyAuthenticated()
Returns true if the current user is authenticated and neither anonymous nor a Remember Me user.
|
boolean |
isRememberMeAuthenticated()
Returns true if the current user is authenticated by a Remember Me token.
|
Authentication |
login(String username,
String password)
Convenience method that invokes
VaadinSecurity.login(org.springframework.security.core.Authentication) with a
UsernamePasswordAuthenticationToken-object. |
void |
setApplicationContext(ApplicationContext applicationContext) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAuthentication, login, logoutpublic boolean isAuthenticated()
VaadinSecurityisAuthenticated in interface VaadinSecuritypublic boolean isAuthenticatedAnonymously()
VaadinSecurityisAuthenticatedAnonymously in interface VaadinSecuritypublic boolean isRememberMeAuthenticated()
VaadinSecurityisRememberMeAuthenticated in interface VaadinSecuritypublic boolean isFullyAuthenticated()
VaadinSecurityisFullyAuthenticated in interface VaadinSecuritypublic Authentication login(String username, String password) throws AuthenticationException, Exception
VaadinSecurityVaadinSecurity.login(org.springframework.security.core.Authentication) with a
UsernamePasswordAuthenticationToken-object.login in interface VaadinSecurityusername - the username to use, must not be null.password - the password to use, must not be null.Authentication token.AuthenticationException - if authentication fails.Exceptionpublic void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionpublic ApplicationContext getApplicationContext()
VaadinSecurityContextnull).getApplicationContext in interface VaadinSecurityContextpublic void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext in interface ApplicationContextAwareBeansExceptionpublic AuthenticationManager getAuthenticationManager()
VaadinSecurityContextAuthenticationManager or null if not
available.getAuthenticationManager in interface VaadinSecurityContextpublic AccessDecisionManager getAccessDecisionManager()
VaadinSecurityContextAccessDecisionManager or null if not available.getAccessDecisionManager in interface VaadinSecurityContextpublic boolean hasAccessDecisionManager()
VaadinSecurityContextAccessDecisionManager is available or not. When this method returns true,
VaadinSecurityContext.getAccessDecisionManager() will always returns a non-null object.hasAccessDecisionManager in interface VaadinSecurityContextpublic boolean hasAuthenticationManager()
VaadinSecurityContextAuthenticationManager is available or not. When this method returns true,
VaadinSecurityContext.getAuthenticationManager() always returns a non-null object.hasAuthenticationManager in interface VaadinSecurityContextpublic RememberMeServices getRememberMeServices()
VaadinSecurityContextRememberMeServices or an instance of
NullRememberMeServices if not available.getRememberMeServices in interface VaadinSecurityContextpublic boolean hasAuthority(String authority)
VaadinSecurityVaadinSecurity.hasAccessToObject(Object, String...).hasAuthority in interface VaadinSecurityauthority - the authority to check, must not be null.SecurityContext contains an
authenticated Authentication
token that has a GrantedAuthority whose string representation
matches the specified authority.Authentication.getAuthorities(),
GrantedAuthority.getAuthority()public boolean hasAuthorities(String... authorities)
VaadinSecurityhasAuthorities in interface VaadinSecurityauthorities - the required authorities.VaadinSecurity.hasAuthority(String),
VaadinSecurity.hasAnyAuthority(String...)public boolean hasAnyAuthority(String... authorities)
VaadinSecurityhasAnyAuthority in interface VaadinSecurityauthorities - the authorities.VaadinSecurity.hasAuthority(String),
VaadinSecurity.hasAuthorities(String...)public boolean hasAccessToObject(Object securedObject, String... securityConfigurationAttributes)
VaadinSecuritySecured annotation).hasAccessToObject in interface VaadinSecuritysecuredObject - the secured object.securityConfigurationAttributes - the security configuration attributes.public boolean hasAccessToSecuredObject(Object securedObject)
VaadinSecurityVaadinSecurity.hasAccessToObject(Object, String...), using the
Secured annotation of the secured object
to get the security configuration attributes.hasAccessToSecuredObject in interface VaadinSecuritysecuredObject - the secured object, must not be null and must have the
Secured annotation.public boolean hasAccessToSecuredMethod(Object securedObject, String methodName, Class<?>... methodParameterTypes)
VaadinSecuritySecured annotation on the specified method to
check if the current user has access to the secured object.hasAccessToSecuredMethod in interface VaadinSecuritysecuredObject - the secured object, must not be null.methodName - the name of the method holding the
Secured annotation.methodParameterTypes - the parameter types of the method holding the
Secured annotation.VaadinSecurity.hasAccessToSecuredObject(Object)Copyright © 2017. All rights reserved.