public class IdentifiedUser extends CurrentUser
| Modifier and Type | Class and Description |
|---|---|
static class |
IdentifiedUser.GenericFactory
Create an IdentifiedUser, ignoring any per-request state.
|
static class |
IdentifiedUser.RequestFactory
Create an IdentifiedUser, relying on current request state.
|
CurrentUser.PropertyKey<T>| Modifier and Type | Method and Description |
|---|---|
IdentifiedUser |
asIdentifiedUser()
Cast to IdentifiedUser if possible.
|
<T> T |
get(CurrentUser.PropertyKey<T> key)
Lookup a previously stored property.
|
Account |
getAccount() |
Account.Id |
getAccountId()
Return account ID if
CurrentUser.isIdentifiedUser() is true. |
GroupMembership |
getEffectiveGroups()
Get the set of groups the user is currently a member of.
|
Set<String> |
getEmailAddresses() |
String |
getName() |
String |
getNameEmail() |
CurrentUser |
getRealUser()
Identity of the authenticated user.
|
String |
getUserName()
Unique name of the user on this server, if one has been assigned.
|
boolean |
hasEmailAddress(String email) |
boolean |
isIdentifiedUser()
Check if user is the IdentifiedUser
|
IdentifiedUser |
materializedCopy()
Returns a materialized copy of the user with all dependencies.
|
org.eclipse.jgit.lib.PersonIdent |
newCommitterIdent(Date when,
TimeZone tz) |
org.eclipse.jgit.lib.PersonIdent |
newRefLogIdent() |
org.eclipse.jgit.lib.PersonIdent |
newRefLogIdent(Date when,
TimeZone tz) |
<T> void |
put(CurrentUser.PropertyKey<T> key,
T value)
Store a property for later retrieval.
|
AccountState |
state() |
String |
toString() |
getAccessPath, getCapabilities, getLastLoginExternalIdKey, isInternalUser, setAccessPath, setLastLoginExternalIdKey, updateRealAccountIdpublic CurrentUser getRealUser()
CurrentUserIn the normal case where a user authenticates as themselves getRealUser() == this.
If X-Gerrit-RunAs or suexec was used this method returns the identity of the
account that has permission to act on behalf of this user.
getRealUser in class CurrentUserpublic AccountState state()
public IdentifiedUser asIdentifiedUser()
CurrentUserasIdentifiedUser in class CurrentUserpublic Account.Id getAccountId()
CurrentUserCurrentUser.isIdentifiedUser() is true.getAccountId in class CurrentUserpublic String getUserName()
CurrentUsergetUserName in class CurrentUserpublic Account getAccount()
public boolean hasEmailAddress(String email)
public String getName()
public String getNameEmail()
public GroupMembership getEffectiveGroups()
CurrentUserThe returned set may be a subset of the user's actual groups; if the user's account is currently deemed to be untrusted then the effective group set is only the anonymous and registered user groups. To enable additional groups (and gain their granted permissions) the user must update their account to use only trusted authentication providers.
getEffectiveGroups in class CurrentUserpublic org.eclipse.jgit.lib.PersonIdent newRefLogIdent()
public boolean isIdentifiedUser()
isIdentifiedUser in class CurrentUserpublic <T> T get(CurrentUser.PropertyKey<T> key)
CurrentUserget in class CurrentUserkey - unique property key.null.public <T> void put(CurrentUser.PropertyKey<T> key, T value)
put in class CurrentUserkey - unique property key.value - value to store; or null to clear the value.public IdentifiedUser materializedCopy()
Invoke all providers and factories of dependent objects and store the references to a copy of the current identified user.