/ Published in: Groovy
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
class BootStrap { def authenticateService //Adding Roles //Adding Users userRealName:'god almighty', enabled: true, emailShow: true, email: '[email protected]', passwd: authenticateService.encodePassword('god')).save() userRealName:'poor slave', enabled: true, emailShow: true, email: '[email protected]', passwd: authenticateService.encodePassword('slave')).save() //Note that here we associate users with their respective roles roleAdmin.addToPeople(userGod) roleUser.addToPeople(userGod) roleUser.addToPeople(userSlave) } } }