Changeset 2232

Show
Ignore:
Timestamp:
21-05-12 12:21:56 (2 years ago)
Author:
work@…
Message:

set an api key on update when a user has no api key

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/domain/dbnp/authentication/SecUser.groovy

    r2231 r2232  
    7272    } 
    7373 
     74    /** 
     75     * Before update 
     76     */ 
     77    def beforeUpdate = { 
     78        // got an api key? 
     79        if (!apiKey) { 
     80            // generate an apiKey for this user 
     81            apiKey = UUID.randomUUID().toString() 
     82        } 
     83    } 
     84 
    7485        /** 
    7586         * return the text representation of this user