public abstract class CurrentUser extends Object
This is a RequestScoped
property managed by Guice.
AnonymousUser
,
IdentifiedUser
Modifier | Constructor and Description |
---|---|
protected |
CurrentUser(CapabilityControl.Factory capabilityControlFactory) |
Modifier and Type | Method and Description |
---|---|
AccessPath |
getAccessPath()
How this user is accessing the Gerrit Code Review application.
|
CapabilityControl |
getCapabilities()
Capabilities available to this user account.
|
abstract GroupMembership |
getEffectiveGroups()
Get the set of groups the user is currently a member of.
|
abstract Collection<com.google.gerrit.reviewdb.client.AccountProjectWatch> |
getNotificationFilters()
Filters selecting changes the user wants to monitor.
|
CurrentUser |
getRealUser()
Identity of the authenticated user.
|
abstract Set<com.google.gerrit.reviewdb.client.Change.Id> |
getStarredChanges()
Set of changes starred by this user.
|
String |
getUserName()
Unique name of the user on this server, if one has been assigned.
|
boolean |
isIdentifiedUser()
Check if user is the IdentifiedUser
|
void |
setAccessPath(AccessPath path) |
protected CurrentUser(CapabilityControl.Factory capabilityControlFactory)
public final AccessPath getAccessPath()
public void setAccessPath(AccessPath path)
public CurrentUser getRealUser()
In 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.
public abstract GroupMembership getEffectiveGroups()
The 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.
public abstract Set<com.google.gerrit.reviewdb.client.Change.Id> getStarredChanges()
public abstract Collection<com.google.gerrit.reviewdb.client.AccountProjectWatch> getNotificationFilters()
public String getUserName()
public CapabilityControl getCapabilities()
public boolean isIdentifiedUser()