public interface UserInfo
The current user refers to the authenticated user for whom the request context has been opened. All user information like ids, names, roles, tenant and user attributes are assumed to be verified, i.e. they are secured by adequate means like JWT verification.
Modifier and Type | Method and Description |
---|---|
Stream<String> |
getAttribute(String attribute)
Returns the verified value of the specified attribute as presented in the request.
|
String |
getId()
Returns the verified user id of the request's authenticated user.
|
String |
getName()
Returns the verified user name of the request's authenticated user.
|
String |
getTenant()
Returns the verified tenant of the request's authenticated user.
|
boolean |
hasRole(String role)
Checks if the current user is associated with the specified user role.
|
boolean |
isAuthenticated()
Returns
true if UserInfo is filled with data of an authenticated user |
boolean |
isSystemUser()
Returns
true if the user is a system user and not a named user. |
String getId()
String getName()
String getTenant()
boolean isSystemUser()
true
if the user is a system user and not a named user.true
if the user is a system user and not a named user.boolean hasRole(String role)
role
- The name of the roletrue
if role is present, false
otherwiseStream<String> getAttribute(String attribute)
attribute
- The name of the attributenull
if not existingCopyright © 2020. All rights reserved.