Package com.google.gerrit.server
Class ExternalUser
- java.lang.Object
-
- com.google.gerrit.server.CurrentUser
-
- com.google.gerrit.server.ExternalUser
-
public class ExternalUser extends CurrentUser
Represents a user that does not have a Gerrit account.This user is limited in what they can do on Gerrit. For now, we only guarantee that permission checking - including ref filtering works.
This class is thread-safe.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ExternalUser.Factory
-
Field Summary
-
Fields inherited from class com.google.gerrit.server.CurrentUser
LAST_LOGIN_EXTERNAL_ID_PROPERTY_KEY
-
-
Constructor Summary
Constructors Constructor Description ExternalUser(GroupBackend groupBackend, Collection<String> emailAddresses, Collection<ExternalId.Key> externalIdKeys, PropertyMap propertyMap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getCacheKey()
Returns a unique identifier for this user that is intended to be used as a cache key.GroupMembership
getEffectiveGroups()
Get the set of groups the user is currently a member of.com.google.common.collect.ImmutableSet<String>
getEmailAddresses()
Returns all email addresses associated with this user.com.google.common.collect.ImmutableSet<ExternalId.Key>
getExternalIdKeys()
Returns allExternalId.Key
s associated with this user.-
Methods inherited from class com.google.gerrit.server.CurrentUser
asIdentifiedUser, get, getAccessPath, getAccountId, getLastLoginExternalIdKey, getLoggableName, getRealUser, getUserName, hasSameAccountId, isIdentifiedUser, isImpersonating, isInternalUser, setAccessPath, updateRealAccountId
-
-
-
-
Constructor Detail
-
ExternalUser
@Inject public ExternalUser(GroupBackend groupBackend, Collection<String> emailAddresses, Collection<ExternalId.Key> externalIdKeys, PropertyMap propertyMap)
-
-
Method Detail
-
getEmailAddresses
public com.google.common.collect.ImmutableSet<String> getEmailAddresses()
Description copied from class:CurrentUser
Returns all email addresses associated with this user. ForAnonymousUser
and other users that don't represent a person user or service account, this set will be empty.- Overrides:
getEmailAddresses
in classCurrentUser
-
getExternalIdKeys
public com.google.common.collect.ImmutableSet<ExternalId.Key> getExternalIdKeys()
Description copied from class:CurrentUser
Returns allExternalId.Key
s associated with this user. ForAnonymousUser
and other users that don't represent a person user or service account, this set will be empty.- Overrides:
getExternalIdKeys
in classCurrentUser
-
getEffectiveGroups
public GroupMembership getEffectiveGroups()
Description copied from class:CurrentUser
Get the set of groups the user is currently a member of.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.
- Specified by:
getEffectiveGroups
in classCurrentUser
- Returns:
- active groups for this user.
-
getCacheKey
public Object getCacheKey()
Description copied from class:CurrentUser
Returns a unique identifier for this user that is intended to be used as a cache key. Returned object should to implementequals()
andhashCode()
for effective caching.- Specified by:
getCacheKey
in classCurrentUser
-
-