Changeset 2232


Ignore:
Timestamp:
May 21, 2012, 12:21:56 PM (5 years ago)
Author:
work@…
Message:

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

File:
1 edited

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
Note: See TracChangeset for help on using the changeset viewer.