import org.codehaus.groovy.grails.commons.ConfigurationHolder
import yukihane.coroid.*

class BootStrap {
     def springSecurityService

     def init = { servletContext ->
         def id = ConfigurationHolder.config.coroid.user.id
         def password = springSecurityService.encodePassword(
             ConfigurationHolder.config.coroid.user.password)

         def user = new User(username:id, password: password, enabled: true).save()
         def role = new Role(authority: 'ROLE_USER').save()
         UserRole.create(user, role)
     }
     def destroy = {
     }
} 