public interface VaadinSecurity extends VaadinSecurityContext
| Modifier and Type | Method and Description |
|---|---|
Authentication |
getAuthentication()
Gets the authentication token of the current user.
|
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
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 |
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(Authentication authentication)
Tries to login using the specified authentication object.
|
Authentication |
login(String username,
String password)
Convenience method that invokes
login(org.springframework.security.core.Authentication) with a
UsernamePasswordAuthenticationToken-object. |
void |
logout()
Logs the user out.
|
getAccessDecisionManager, getApplicationContext, getAuthenticationManager, getRememberMeServices, hasAccessDecisionManager, hasAuthenticationManagerboolean isAuthenticated()
boolean isAuthenticatedAnonymously()
boolean isRememberMeAuthenticated()
boolean isFullyAuthenticated()
Authentication login(Authentication authentication) throws AuthenticationException, Exception
authentication - the authentication object to authenticate, must not be null.Authentication token.AuthenticationException - if authentication fails.ExceptionAuthentication login(String username, String password) throws AuthenticationException, Exception
login(org.springframework.security.core.Authentication) with a
UsernamePasswordAuthenticationToken-object.username - the username to use, must not be null.password - the password to use, must not be null.Authentication token.AuthenticationException - if authentication fails.Exceptionvoid logout()
boolean hasAuthority(String authority)
hasAccessToObject(Object, String...).authority - 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()Authentication getAuthentication()
Authentication token stored in the current
SecurityContext, or null.boolean hasAccessToObject(Object securedObject, String... securityConfigurationAttributes)
Secured annotation).securedObject - the secured object.securityConfigurationAttributes - the security configuration attributes.boolean hasAccessToSecuredObject(Object securedObject)
hasAccessToObject(Object, String...), using the
Secured annotation of the secured object
to get the security configuration attributes.securedObject - the secured object, must not be null and must have the
Secured annotation.boolean hasAccessToSecuredMethod(Object securedObject, String methodName, Class<?>... methodParameterTypes)
Secured annotation on the specified method to
check if the current user has access to the secured object.securedObject - 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.hasAccessToSecuredObject(Object)boolean hasAuthorities(String... authorities)
authorities - the required authorities.hasAuthority(String),
hasAnyAuthority(String...)boolean hasAnyAuthority(String... authorities)
authorities - the authorities.hasAuthority(String),
hasAuthorities(String...)Copyright © 2017. All rights reserved.