Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import comingsoon.*
- class BootStrap {
- def init = { servletContext ->
- def adminRole = Role.findByAuthority('ROLE_ADMIN') ?: new Role(authority:'ROLE_ADMIN').save(insert:true,flush:true)
- println adminRole
- if (User.count() == 0){
- def admin = new User(username:'admin',password:'admin',enabled:true).save(flush:true,insert:true,failOnError:true)
- println admin
- def userRole = UserRole.create(admin,adminRole)
- println userRole
- println admin
- }
- }
- def destroy = {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement