Last change
on this file since 1144 was
1144,
checked in by robert@…, 12 years ago
|
Added an expiry date to the confirmation email for the user and administrator. See ticket #189
|
File size:
1.0 KB
|
Line | |
---|
1 | package dbnp.authentication |
---|
2 | |
---|
3 | class SecUser implements Serializable { |
---|
4 | |
---|
5 | String username |
---|
6 | String password |
---|
7 | String email |
---|
8 | Date dateCreated |
---|
9 | boolean enabled |
---|
10 | boolean accountExpired |
---|
11 | boolean accountLocked |
---|
12 | boolean passwordExpired |
---|
13 | boolean userConfirmed // True if the user has confirmed his subscription using the link in the email |
---|
14 | boolean adminConfirmed // True if the administrator has confirmed this subscription using the link in the email |
---|
15 | |
---|
16 | static constraints = { |
---|
17 | username blank: false, unique: true |
---|
18 | password blank: false |
---|
19 | email blank: false |
---|
20 | } |
---|
21 | |
---|
22 | static mapping = { |
---|
23 | password column: '`password`' |
---|
24 | enabled formula: 'USER_CONFIRMED AND ADMIN_CONFIRMED' |
---|
25 | } |
---|
26 | |
---|
27 | Set<SecRole> getAuthorities() { |
---|
28 | SecUserSecRole.findAllBySecUser(this).collect { it.secRole } as Set |
---|
29 | } |
---|
30 | |
---|
31 | public boolean equals(Object y) |
---|
32 | { |
---|
33 | if( !( y instanceof SecUser ) ) { |
---|
34 | return false; |
---|
35 | } |
---|
36 | |
---|
37 | if (y == null) return false; |
---|
38 | |
---|
39 | return this.id == y.id |
---|
40 | } |
---|
41 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.