comparison gwt-client/src/main/java/org/dive4elements/river/client/server/auth/DefaultUser.java @ 5838:5aa05a7a34b7

Rename modules to more fitting names.
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 15:23:37 +0200
parents flys-client/src/main/java/org/dive4elements/river/client/server/auth/DefaultUser.java@821a02bbfb4e
children 172338b1407f
comparison
equal deleted inserted replaced
5837:d9901a08d0a6 5838:5aa05a7a34b7
1 package org.dive4elements.river.client.server.auth;
2
3 import java.util.List;
4
5 public class DefaultUser
6 implements User
7 {
8 protected String name;
9 protected String account;
10 protected String password;
11 protected boolean expired;
12 protected List<String> roles;
13 protected List<String> features;
14
15 public DefaultUser() {
16 }
17
18 public DefaultUser(
19 String name,
20 String password,
21 boolean expired,
22 List<String> roles,
23 List<String> features
24 ) {
25 this.name = name;
26 this.password = password;
27 this.expired = expired;
28 this.roles = roles;
29 this.features = features;
30 this.account = name;
31 }
32
33 @Override
34 public String getName() {
35 return name;
36 }
37
38 public void setName(String name) {
39 this.name = name;
40 }
41
42 @Override
43 public String getPassword() {
44 return password;
45 }
46
47 public void setPassword(String password) {
48 this.password = password;
49 }
50
51 @Override
52 public boolean hasExpired() {
53 return expired;
54 }
55
56 public void setExpired(boolean expired) {
57 this.expired = expired;
58 }
59
60 @Override
61 public List<String> getRoles() {
62 // XXX: return clone of the list?
63 return this.roles;
64 }
65
66 public void setRoles(List<String> roles) {
67 this.roles = roles;
68 }
69
70 @Override
71 public boolean canUseFeature(String feature) {
72 return this.features.contains(feature);
73 }
74
75 public void setAllowedFeatures(List<String> features) {
76 this.features = features;
77 }
78
79 @Override
80 public String getAccount() {
81 return this.account;
82 }
83
84 public void setAccount(String account) {
85 this.account = account;
86 }
87 }
88 // vim:set ts=4 sw=4 si et fenc=utf8 tw=80:

http://dive4elements.wald.intevation.org