Changeset 34 for trunk/grails-app/conf
- Timestamp:
- Oct 27, 2009, 1:32:34 PM (14 years ago)
- Location:
- trunk/grails-app/conf
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/BootStrap.groovy
r29 r34 17 17 if (GrailsUtil.environment == GrailsApplication.ENV_DEVELOPMENT) { 18 18 printf("development bootstrapping....\n\n"); 19 20 // add roles21 def AuthRole1 = new AuthRole(name:'Administrator', description:'Super user').save();22 def AuthRole2 = new AuthRole(name:'Group Administrator', description:'Group Super user').save();23 def AuthRole3 = new AuthRole(name:'Study Owner', description:'The creator of a study').save();24 25 // add actions26 def AuthAction1 = new AuthAction(controller:'test', action:'index').save();27 def AuthAction2 = new AuthAction(controller:'test', action:'sayHello').save();28 def AuthAction3 = new AuthAction(controller:'test', action:'sayWeather').save();29 30 // authorize super user for everything31 AuthRole1.addToActions(AuthAction1).save();32 AuthRole1.addToActions(AuthAction2).save();33 AuthRole1.addToActions(AuthAction3).save();34 35 // authorize group admin only for index and hello36 AuthRole2.addToActions(AuthAction1).save();37 AuthRole2.addToActions(AuthAction2).save();38 39 // authorize study owner only for index40 AuthRole3.addToActions(AuthAction1).save();41 42 // add users43 def User1 = new AuthUser(username:'admin', password:'admin', firstName:'super', lastName:'User', email:'info@osx.eu').save();44 def User2 = new AuthUser(username:'duh', password:'duh', firstname:'Jeroen', lastname:'Wesbeek', email:'j.a.m.wesbeek@umail.leidenuniv.nl').save();45 46 // add group structure47 def AuthGroup1 = new AuthGroup(name:'root', description:'the root of everything').save();48 def AuthGroup2 = new AuthGroup(name:'TNO', description:'TNO - nation wide company').save();49 def AuthGroup3 = new AuthGroup(name:'KVL', description:'TNO - quality of life').save();50 def AuthGroup4 = new AuthGroup(name:'BSC', description:'BioSciences').save();51 52 // create group tree 4 -> 3 -> 2 -> 153 AuthGroup4.addToGroups(AuthGroup3).save();54 AuthGroup3.addToGroups(AuthGroup2).save();55 AuthGroup2.addToGroups(AuthGroup1).save();56 57 // add users to groups58 //User1.addToGroups(AuthGroup1).save();59 //User2.addToGroups(AuthGroup4).save();60 61 19 62 20 }
Note: See TracChangeset
for help on using the changeset viewer.