Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/server/auth/was/User.java @ 5350:2f6e6ae2fc56
Add small howto which consists mostly of the notes i took while
adding the HWSLines / Points wms artifacts
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Wed, 20 Mar 2013 16:42:52 +0100 |
parents | 1387cdeb8d93 |
children |
rev | line source |
---|---|
2956
d7f76f197d89
Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.server.auth.was; |
d7f76f197d89
Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
2 |
2966
d115f719f0c0
Derive was User class from new DefaultUser class
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2959
diff
changeset
|
3 import java.util.Date; |
2978
98514ab2c9ba
Implement getting a list of roles from a logged in user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2966
diff
changeset
|
4 import java.util.List; |
2956
d7f76f197d89
Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
5 |
2966
d115f719f0c0
Derive was User class from new DefaultUser class
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2959
diff
changeset
|
6 import de.intevation.flys.client.server.auth.DefaultUser; |
2956
d7f76f197d89
Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
7 |
2966
d115f719f0c0
Derive was User class from new DefaultUser class
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2959
diff
changeset
|
8 public class User |
d115f719f0c0
Derive was User class from new DefaultUser class
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2959
diff
changeset
|
9 extends DefaultUser |
d115f719f0c0
Derive was User class from new DefaultUser class
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2959
diff
changeset
|
10 implements de.intevation.flys.client.server.auth.User { |
d115f719f0c0
Derive was User class from new DefaultUser class
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2959
diff
changeset
|
11 |
d115f719f0c0
Derive was User class from new DefaultUser class
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2959
diff
changeset
|
12 private Assertion assertion; |
d115f719f0c0
Derive was User class from new DefaultUser class
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2959
diff
changeset
|
13 |
3486
23095983c249
Implement Features handling for WAS authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2978
diff
changeset
|
14 public User(String name, |
23095983c249
Implement Features handling for WAS authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2978
diff
changeset
|
15 String password, |
3504
1387cdeb8d93
Add account information to flys-client user classes
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3486
diff
changeset
|
16 String account, |
3486
23095983c249
Implement Features handling for WAS authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2978
diff
changeset
|
17 List<String> roles, |
23095983c249
Implement Features handling for WAS authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2978
diff
changeset
|
18 Assertion assertion, |
23095983c249
Implement Features handling for WAS authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2978
diff
changeset
|
19 List<String> features |
23095983c249
Implement Features handling for WAS authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2978
diff
changeset
|
20 ) { |
2978
98514ab2c9ba
Implement getting a list of roles from a logged in user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2966
diff
changeset
|
21 this.setName(name); |
98514ab2c9ba
Implement getting a list of roles from a logged in user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2966
diff
changeset
|
22 this.setPassword(password); |
98514ab2c9ba
Implement getting a list of roles from a logged in user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2966
diff
changeset
|
23 this.setRoles(roles); |
2966
d115f719f0c0
Derive was User class from new DefaultUser class
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2959
diff
changeset
|
24 this.assertion = assertion; |
3486
23095983c249
Implement Features handling for WAS authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2978
diff
changeset
|
25 this.setAllowedFeatures(features); |
3504
1387cdeb8d93
Add account information to flys-client user classes
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3486
diff
changeset
|
26 this.setAccount(account); |
2956
d7f76f197d89
Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
27 } |
d7f76f197d89
Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
28 |
2966
d115f719f0c0
Derive was User class from new DefaultUser class
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2959
diff
changeset
|
29 @Override |
2959
5ba0a6efdf3b
Auth: added simple file based authentication.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2956
diff
changeset
|
30 public boolean hasExpired() { |
2966
d115f719f0c0
Derive was User class from new DefaultUser class
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2959
diff
changeset
|
31 Date until = this.assertion.getUntil(); |
d115f719f0c0
Derive was User class from new DefaultUser class
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2959
diff
changeset
|
32 if (until != null) { |
d115f719f0c0
Derive was User class from new DefaultUser class
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2959
diff
changeset
|
33 Date current = new Date(); |
d115f719f0c0
Derive was User class from new DefaultUser class
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2959
diff
changeset
|
34 return !current.after(until); |
d115f719f0c0
Derive was User class from new DefaultUser class
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2959
diff
changeset
|
35 } |
2956
d7f76f197d89
Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
36 return false; |
d7f76f197d89
Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
37 } |
d7f76f197d89
Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
38 } |
d7f76f197d89
Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
39 |
d7f76f197d89
Refactor GGInA authentication
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
40 // vim:set ts=4 sw=4 si et fenc=utf8 tw=80: |