Mercurial > dive4elements > river
diff gwt-client/src/main/java/org/dive4elements/river/client/server/auth/DefaultUser.java @ 9497:d6d5ca6d4af0
Enabled logging of saml-group-name in log-ing logfile.
Some cleanup/refaktoring.
author | gernotbelger |
---|---|
date | Thu, 27 Sep 2018 17:40:39 +0200 |
parents | 7bc35bbd8b27 |
children |
line wrap: on
line diff
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/DefaultUser.java Mon Sep 17 19:07:57 2018 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/DefaultUser.java Thu Sep 27 17:40:39 2018 +0200 @@ -10,62 +10,41 @@ import java.util.List; -public class DefaultUser -implements User -{ - protected String name; - protected String account; - protected String password; - protected String samlXML; - protected boolean expired; - protected List<String> roles; - protected List<String> features; - - public DefaultUser() { - } +public class DefaultUser implements User { + private final String name; + private final String account; + private final String password; + private final String samlXML; + private final boolean expired; + private final List<String> roles; + private final List<String> features; + private final String userGroup; - public DefaultUser( - String name, - String password, - String samlXML, - boolean expired, - List<String> roles, - List<String> features - ) { - this.name = name; + public DefaultUser(final String name, final String password, final String samlXML, final boolean expired, final List<String> roles, + final List<String> features, final String userGroup) { + this.name = name; this.password = password; - this.samlXML = samlXML; - this.expired = expired; - this.roles = roles; + this.samlXML = samlXML; + this.expired = expired; + this.roles = roles; this.features = features; - this.account = name; + this.account = name; + this.userGroup = userGroup; } @Override public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; + return this.name; } @Override public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; + return this.password; } @Override public boolean hasExpired() { - return expired; - } - - public void setExpired(boolean expired) { - this.expired = expired; + return this.expired; } @Override @@ -74,35 +53,27 @@ return this.roles; } - public void setRoles(List<String> roles) { - this.roles = roles; + public List<String> getAllowedFeatures() { + return this.features; } @Override - public boolean canUseFeature(String feature) { + public boolean canUseFeature(final String feature) { return this.features.contains(feature); } - public void setAllowedFeatures(List<String> features) { - this.features = features; - } - @Override public String getAccount() { return this.account; } - public void setAccount(String account) { - this.account = account; - } - @Override public String getSamlXMLBase64() { return this.samlXML; } - public void setSamlXMLBase64(String samlXML) { - this.samlXML = samlXML; + @Override + public String getUserGroup() { + return this.userGroup; } -} -// vim:set ts=4 sw=4 si et fenc=utf8 tw=80: +} \ No newline at end of file