public class SecurityUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static Collection<? extends org.springframework.security.core.GrantedAuthority> |
convertToGrantedAuthorities(List<String> roles)
Converts a list of
String roles into GrantedAuthority objects. |
static boolean |
isCurrentUserAuthenticated()
Checks whether the current user is authenticated.
|
public static boolean isCurrentUserAuthenticated()
true if the user is authenticated, false otherwisepublic static Collection<? extends org.springframework.security.core.GrantedAuthority> convertToGrantedAuthorities(List<String> roles)
String roles into GrantedAuthority objects.roles - A collection of security roles, in the format of ROLE_ANONYMOUS.SimpleGrantedAuthority objects.Copyright © 2018. All rights reserved.