Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/server/auth/saml/User.java @ 5947:0b092a1d136b
Move User class from was to saml sub-package.
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Wed, 08 May 2013 17:56:14 +0200 |
parents | gwt-client/src/main/java/org/dive4elements/river/client/server/auth/was/User.java@d6f13dba21fe |
children | d7b9b3e3c61a |
comparison
equal
deleted
inserted
replaced
5946:2f176892971f | 5947:0b092a1d136b |
---|---|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde | |
2 * Software engineering by Intevation GmbH | |
3 * | |
4 * This file is Free Software under the GNU AGPL (>=v3) | |
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
6 * documentation coming with Dive4Elements River for details. | |
7 */ | |
8 | |
9 package org.dive4elements.river.client.server.auth.saml; | |
10 | |
11 import java.util.Date; | |
12 import java.util.List; | |
13 | |
14 import org.dive4elements.river.client.server.auth.DefaultUser; | |
15 import org.dive4elements.river.client.server.auth.saml.Assertion; | |
16 | |
17 public class User | |
18 extends DefaultUser | |
19 implements org.dive4elements.river.client.server.auth.User { | |
20 | |
21 private Assertion assertion; | |
22 | |
23 public User(String name, | |
24 String password, | |
25 String account, | |
26 List<String> roles, | |
27 Assertion assertion, | |
28 List<String> features | |
29 ) { | |
30 this.setName(name); | |
31 this.setPassword(password); | |
32 this.setRoles(roles); | |
33 this.assertion = assertion; | |
34 this.setAllowedFeatures(features); | |
35 this.setAccount(account); | |
36 } | |
37 | |
38 @Override | |
39 public boolean hasExpired() { | |
40 Date until = this.assertion.getUntil(); | |
41 if (until != null) { | |
42 Date current = new Date(); | |
43 return !current.after(until); | |
44 } | |
45 return false; | |
46 } | |
47 } | |
48 | |
49 // vim:set ts=4 sw=4 si et fenc=utf8 tw=80: |