Mercurial > dive4elements > river
comparison 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 |
comparison
equal
deleted
inserted
replaced
9486:ce13a2f07290 | 9497:d6d5ca6d4af0 |
---|---|
8 | 8 |
9 package org.dive4elements.river.client.server.auth; | 9 package org.dive4elements.river.client.server.auth; |
10 | 10 |
11 import java.util.List; | 11 import java.util.List; |
12 | 12 |
13 public class DefaultUser | 13 public class DefaultUser implements User { |
14 implements User | 14 private final String name; |
15 { | 15 private final String account; |
16 protected String name; | 16 private final String password; |
17 protected String account; | 17 private final String samlXML; |
18 protected String password; | 18 private final boolean expired; |
19 protected String samlXML; | 19 private final List<String> roles; |
20 protected boolean expired; | 20 private final List<String> features; |
21 protected List<String> roles; | 21 private final String userGroup; |
22 protected List<String> features; | |
23 | 22 |
24 public DefaultUser() { | 23 public DefaultUser(final String name, final String password, final String samlXML, final boolean expired, final List<String> roles, |
25 } | 24 final List<String> features, final String userGroup) { |
26 | 25 this.name = name; |
27 public DefaultUser( | |
28 String name, | |
29 String password, | |
30 String samlXML, | |
31 boolean expired, | |
32 List<String> roles, | |
33 List<String> features | |
34 ) { | |
35 this.name = name; | |
36 this.password = password; | 26 this.password = password; |
37 this.samlXML = samlXML; | 27 this.samlXML = samlXML; |
38 this.expired = expired; | 28 this.expired = expired; |
39 this.roles = roles; | 29 this.roles = roles; |
40 this.features = features; | 30 this.features = features; |
41 this.account = name; | 31 this.account = name; |
32 this.userGroup = userGroup; | |
42 } | 33 } |
43 | 34 |
44 @Override | 35 @Override |
45 public String getName() { | 36 public String getName() { |
46 return name; | 37 return this.name; |
47 } | |
48 | |
49 public void setName(String name) { | |
50 this.name = name; | |
51 } | 38 } |
52 | 39 |
53 @Override | 40 @Override |
54 public String getPassword() { | 41 public String getPassword() { |
55 return password; | 42 return this.password; |
56 } | |
57 | |
58 public void setPassword(String password) { | |
59 this.password = password; | |
60 } | 43 } |
61 | 44 |
62 @Override | 45 @Override |
63 public boolean hasExpired() { | 46 public boolean hasExpired() { |
64 return expired; | 47 return this.expired; |
65 } | |
66 | |
67 public void setExpired(boolean expired) { | |
68 this.expired = expired; | |
69 } | 48 } |
70 | 49 |
71 @Override | 50 @Override |
72 public List<String> getRoles() { | 51 public List<String> getRoles() { |
73 // XXX: return clone of the list? | 52 // XXX: return clone of the list? |
74 return this.roles; | 53 return this.roles; |
75 } | 54 } |
76 | 55 |
77 public void setRoles(List<String> roles) { | 56 public List<String> getAllowedFeatures() { |
78 this.roles = roles; | 57 return this.features; |
79 } | 58 } |
80 | 59 |
81 @Override | 60 @Override |
82 public boolean canUseFeature(String feature) { | 61 public boolean canUseFeature(final String feature) { |
83 return this.features.contains(feature); | 62 return this.features.contains(feature); |
84 } | |
85 | |
86 public void setAllowedFeatures(List<String> features) { | |
87 this.features = features; | |
88 } | 63 } |
89 | 64 |
90 @Override | 65 @Override |
91 public String getAccount() { | 66 public String getAccount() { |
92 return this.account; | 67 return this.account; |
93 } | 68 } |
94 | 69 |
95 public void setAccount(String account) { | |
96 this.account = account; | |
97 } | |
98 | |
99 @Override | 70 @Override |
100 public String getSamlXMLBase64() { | 71 public String getSamlXMLBase64() { |
101 return this.samlXML; | 72 return this.samlXML; |
102 } | 73 } |
103 | 74 |
104 public void setSamlXMLBase64(String samlXML) { | 75 @Override |
105 this.samlXML = samlXML; | 76 public String getUserGroup() { |
77 return this.userGroup; | |
106 } | 78 } |
107 } | 79 } |
108 // vim:set ts=4 sw=4 si et fenc=utf8 tw=80: |