Last change
on this file since 976 was
976,
checked in by robert@…, 12 years ago
|
Authentication and authorization for studies is added, according to ticket 118
|
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 | boolean enabled |
---|
9 | boolean accountExpired |
---|
10 | boolean accountLocked |
---|
11 | boolean passwordExpired |
---|
12 | boolean userConfirmed // True if the user has confirmed his subscription using the link in the email |
---|
13 | boolean adminConfirmed // True if the administrator has confirmed this subscription using the link in the email |
---|
14 | |
---|
15 | static constraints = { |
---|
16 | username blank: false, unique: true |
---|
17 | password blank: false |
---|
18 | email blank: false |
---|
19 | } |
---|
20 | |
---|
21 | static mapping = { |
---|
22 | password column: '`password`' |
---|
23 | enabled formula: 'USER_CONFIRMED AND ADMIN_CONFIRMED' |
---|
24 | } |
---|
25 | |
---|
26 | Set<SecRole> getAuthorities() { |
---|
27 | SecUserSecRole.findAllBySecUser(this).collect { it.secRole } as Set |
---|
28 | } |
---|
29 | |
---|
30 | public boolean equals(Object y) |
---|
31 | { |
---|
32 | if( !( y instanceof SecUser ) ) { |
---|
33 | return false; |
---|
34 | } |
---|
35 | |
---|
36 | if (y == null) return false; |
---|
37 | |
---|
38 | return this.id == y.id |
---|
39 | } |
---|
40 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.