UserMemento (record)
Immutable serializable value holding details about a user and its roles.
API
record UserMemento {
public static final String LOGICAL_TYPE_NAME;
public static final String AUTHORIZED_USER_ROLE; (1)
UserMemento system() (2)
UserMemento ofName(String name) (3)
UserMemento ofNameAndRoles(String name, RoleMemento... roles) (4)
UserMemento ofNameAndRoleNames(String name, String... roleNames) (5)
UserMemento ofNameAndRoleNames(String name, List<String> roleNames) (6)
UserMemento ofNameAndRoleNames(String name, Stream<String> roleNames) (7)
String nameFormatted()
UserMemento withRoleAdded(String role)
boolean isCurrentUser(String userName) (8)
Stream<String> streamRoleNames()
boolean hasRoleName(String roleName)
boolean hasSudoAccessAllRole() (9)
UserMementoBuilder asBuilder()
UserLocale asUserLocale()
UserMementoBuilder builder(String name)
UserMemento withRealName(String realName)
UserMemento withAvatarUrl(URL avatarUrl)
UserMemento withImpersonating(boolean impersonating)
UserMemento withAuthenticationCode(String authenticationCode)
UserMemento withAuthenticationSource(AuthenticationSource authenticationSource)
UserMemento withMultiTenancyToken(String multiTenancyToken)
UserMemento withLanguageLocale(Locale languageLocale)
UserMemento withNumberFormatLocale(Locale numberFormatLocale)
UserMemento withTimeFormatLocale(Locale timeFormatLocale)
boolean equals(Object obj)
int hashCode()
String getName() (10)
String getAuthenticationCode() (11)
AuthenticationSource getAuthenticationSource() (12)
URL getAvatarUrl() (13)
String getRealName() (14)
Locale getLanguageLocale() (15)
Locale getnumberFormatLocale() (16)
Locale getTimeFormatLocale() (17)
String getMultiTenancyToken() (18)
List<RoleMemento> getRoles() (19)
}
1 | AUTHORIZED_USER_ROLE
Also used by the wicket-viewer and its AuthorizeInstantiation(…) annotations; the actual value is arbitrary; however, we use namespace style to clarify the origin |
||
2 | system()
The framework’s internal user with unrestricted privileges. |
||
3 | ofName(String)
Creates a new user with the specified name and no roles. |
||
4 | ofNameAndRoles(String, RoleMemento)
Creates a new user with the specified name and assigned roles. |
||
5 | ofNameAndRoleNames(String, String)
Creates a new user with the specified name and assigned role names. |
||
6 | ofNameAndRoleNames(String, List)
Creates a new user with the specified name and assigned role names. |
||
7 | ofNameAndRoleNames(String, Stream)
Creates a new user with the specified name and assigned role names. |
||
8 | isCurrentUser(String)
Determine if the specified name is this user. |
||
9 | hasSudoAccessAllRole()
Whether this UserMemento 's UserMemento#roles() roles contains the SudoService 's SudoService#ACCESS_ALL_ROLE ACCESS_ALL_ROLE role (meaning that security checks are disabled). |
||
10 | getName()
|
||
11 | getAuthenticationCode()
|
||
12 | getAuthenticationSource()
|
||
13 | getAvatarUrl()
|
||
14 | getRealName()
|
||
15 | getLanguageLocale()
|
||
16 | getnumberFormatLocale()
|
||
17 | getTimeFormatLocale()
|
||
18 | getMultiTenancyToken()
|
||
19 | getRoles()
|
Members
AUTHORIZED_USER_ROLE
Also used by the wicket-viewer and its AuthorizeInstantiation(…) annotations; the actual value is arbitrary; however, we use namespace style to clarify the origin
ofNameAndRoleNames(String, String)
Creates a new user with the specified name and assigned role names.
ofNameAndRoleNames(String, List)
Creates a new user with the specified name and assigned role names.
ofNameAndRoleNames(String, Stream)
Creates a new user with the specified name and assigned role names.
hasSudoAccessAllRole()
Whether this UserMemento 's UserMemento#roles() roles contains the SudoService 's SudoService#ACCESS_ALL_ROLE ACCESS_ALL_ROLE role (meaning that security checks are disabled).