public interface SecurityService
Modifier and Type | Method and Description |
---|---|
java.util.Optional<Authentication> |
getAuthentication()
Retrieves
Authentication if authenticated. |
boolean |
hasRole(java.lang.String role)
If the current user has a specific role.
|
boolean |
hasRole(java.lang.String role,
java.lang.String rolesKey)
Deprecated.
use
instead |
boolean |
isAuthenticated()
Check if a user is authenticated.
|
java.util.Optional<java.lang.String> |
username()
Get the username of the current user.
|
java.util.Optional<java.lang.String> username()
java.util.Optional<Authentication> getAuthentication()
Authentication
if authenticated.Authentication
of the current userboolean isAuthenticated()
boolean hasRole(java.lang.String role)
role
- the role to check@Deprecated boolean hasRole(java.lang.String role, java.lang.String rolesKey)
instead
role
- the authority to checkrolesKey
- The map key to be used in the authentications attributes. E.g. "roles".