Changeset 154 for trunk/grails-app
- Timestamp:
- Oct 17, 2009, 11:49:45 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/domain/Person.groovy
r147 r154 1 1 class Person { 2 2 static transients = ['pass'] 3 3 static hasMany = [authorities: Authority, 4 4 personGroups: PersonGroup, … … 9 9 static belongsTo = [Authority, PersonGroup] 10 10 11 12 11 String loginName 12 String firstName 13 13 String lastName 14 14 String employeeID … … 17 17 Integer sessionTimeout = 43200 18 18 19 20 19 /** MD5 Password */ 20 String password 21 21 22 23 22 /** enabled */ 23 boolean isActive = true 24 24 25 26 25 String email 26 boolean emailShow = true 27 27 28 29 28 /** description */ 29 String description = '' 30 30 31 32 31 /** plain password to create a MD5 password */ 32 String pass 33 33 34 35 36 34 static constraints = { 35 loginName(blank: false, unique: true, minSize:4) //minSize:7 36 firstName(blank: false) 37 37 lastName(blank: false) 38 38 employeeID(blank: true, nullable:true) … … 42 42 isActive() 43 43 //Enforcing minSize on password does not work since "" gets encoded to a string. 44 44 password(blank: false) 45 45 //So we need to use pass for validation then encode it for above. 46 46 pass(blank: false, minSize:4) //minSize:7 47 47 sessionTimeout(min:60, max:43200) 48 48 49 49 } 50 50 51 51 //Overriding the default toString method
Note: See TracChangeset
for help on using the changeset viewer.