commit | 2ad46e1816ed78df23ca1ed3a0c3cf9abe625fb9 | [log] [tgz] |
---|---|---|
author | Shawn O. Pearce <sop@google.com> | Tue Jun 21 16:02:04 2011 -0700 |
committer | Shawn O. Pearce <sop@google.com> | Tue Jun 21 16:11:05 2011 -0700 |
tree | 2eade379f3b30c3640a56fc24e2d71176dd5acfb | |
parent | e34f2ae31b10c0b292561161b19d1eccc8b7e3fd [diff] |
Hoist getUserName up onto CurrentUser Since all users have a unique username on the server, this makes it cleaner to determine who is who. Change-Id: Ifc97f3c3a5b469182beb95fdc2689e226cc38181
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/CurrentUser.java b/gerrit-server/src/main/java/com/google/gerrit/server/CurrentUser.java index 5a68212..b9404b0 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/CurrentUser.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/CurrentUser.java
@@ -68,6 +68,11 @@ /** Filters selecting changes the user wants to monitor. */ public abstract Collection<AccountProjectWatch> getNotificationFilters(); + /** Unique name of the user on this server, if one has been assigned. */ + public String getUserName() { + return null; + } + /** Capabilities available to this user account. */ public CapabilityControl getCapabilities() { CapabilityControl ctl = capabilities;
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/IdentifiedUser.java b/gerrit-server/src/main/java/com/google/gerrit/server/IdentifiedUser.java index 7c0e51e..722e3d7 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/IdentifiedUser.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/IdentifiedUser.java
@@ -228,6 +228,7 @@ } /** @return the user's user name; null if one has not been selected/assigned. */ + @Override public String getUserName() { return state().getUserName(); }