Changeset 198 for trunk/grails-app/services
- Timestamp:
- Nov 27, 2009, 1:54:05 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/services/PersonService.groovy
r182 r198 1 /* Provides a service class with some methods that integrate the Person domain class and Acegi security. 1 /** 2 * Provides a service class with some methods that integrate the Person domain class and Acegi security. 2 3 * 3 4 */ … … 8 9 def authenticateService 9 10 10 // Get current user as a Person and in a safe way to avoid a null userDomain during bootstrap. 11 /** 12 * Get the current user in a safe way to avoid a null userDomain. 13 * @returns The current user or the 'system' person (Person #1) if userDomain() is not active. 14 */ 11 15 def currentUser() { 12 16 if(authenticateService.userDomain()) { … … 14 18 } 15 19 else { 16 //println "Warning: userDomain not active yet, attempting to return Person #1"20 log.warn "userDomain not active, attempting to return Person #1." 17 21 return Person.get(1) 18 22 } 19 23 } 20 24 21 // Convenience wrapper. 25 /** 26 * Convenience wrapper around authenticateService.encodePassword(). 27 * @param passClearText The clear text password to encode. 28 * @returns The encoded password. 29 */ 22 30 def encodePassword(passClearText) { 23 31 authenticateService.encodePassword(passClearText)
Note: See TracChangeset
for help on using the changeset viewer.