| | |
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | public static final UserModel ANONYMOUS = new UserModel("anonymous", false);
|
| | | public static final UserModel ANONYMOUS = new UserModel();
|
| | |
|
| | | // field names are reflectively mapped in EditUser page
|
| | | public String username;
|
| | |
| | | public String emailAddress;
|
| | | public boolean canAdmin;
|
| | | public boolean canFork;
|
| | | public boolean canCreate;
|
| | | public boolean excludeFromFederation;
|
| | | public final Set<String> repositories = new HashSet<String>();
|
| | | public final Set<TeamModel> teams = new HashSet<TeamModel>();
|
| | |
| | | this.isAuthenticated = true;
|
| | | }
|
| | |
|
| | | private UserModel(String username, boolean authenticated) {
|
| | | this.username = username;
|
| | | this.isAuthenticated = authenticated;
|
| | | private UserModel() {
|
| | | this.username = "$anonymous";
|
| | | this.isAuthenticated = false;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | }
|
| | | return displayName;
|
| | | }
|
| | | |
| | | public String getPersonalPath() {
|
| | | return "~" + username;
|
| | | }
|
| | | |
| | | @Override
|
| | | public int hashCode() {
|
| | | return username.hashCode();
|
| | | }
|
| | | |
| | | @Override
|
| | | public boolean equals(Object o) {
|
| | | if (o instanceof UserModel) {
|
| | | return username.equals(((UserModel) o).username);
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String toString() {
|