Changeset 431 for trunk/grails-app/services
- Timestamp:
- Mar 5, 2010, 12:45:43 PM (15 years ago)
- Location:
- trunk/grails-app/services
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/services/CreateDataService.groovy
r420 r431 112 112 createDemoSuppliers() 113 113 createDemoManufacturers() 114 createDemoProductionReference() 114 115 115 116 // Tasks … … 146 147 147 148 // Authority #1 148 authInstance = new Authority(description:"Application Admin, not required for daily use! Grants full admin access to the application.", 149 authInstance = new Authority(description:"Application Admin, not required for daily use! \ 150 Grants full admin access to the application.", 149 151 authority:"ROLE_AppAdmin") 150 152 saveAndTest(authInstance) … … 157 159 // Authority #2 158 160 authInstance = new Authority(description:"Business Manager, grants full management access.", 159 authority:"ROLE_Manager")161 authority:"ROLE_Manager") 160 162 saveAndTest(authInstance) 161 163 162 164 // Authority #3 163 authInstance = new Authority(description:"Application User, all application users need this base role to allow login.", 164 authority:"ROLE_AppUser") 165 authInstance = new Authority(description:"Application User, all application users need this base role \ 166 to allow login.", 167 authority:"ROLE_AppUser") 165 168 saveAndTest(authInstance) 166 169 167 170 // Authority #4 168 171 authInstance = new Authority(description:"Task Manager", 169 authority:"ROLE_TaskManager")172 authority:"ROLE_TaskManager") 170 173 saveAndTest(authInstance) 171 174 172 175 // Authority #5 173 176 authInstance = new Authority(description:"Task User", 174 authority:"ROLE_TaskUser")177 authority:"ROLE_TaskUser") 175 178 saveAndTest(authInstance) 176 179 177 180 // Authority #6 178 181 authInstance = new Authority(description:"Inventory Manager", 179 authority:"ROLE_InventoryManager")182 authority:"ROLE_InventoryManager") 180 183 saveAndTest(authInstance) 181 184 182 185 // Authority #7 183 186 authInstance = new Authority(description:"Inventory User", 184 authority:"ROLE_InventoryUser")187 authority:"ROLE_InventoryUser") 185 188 saveAndTest(authInstance) 186 189 187 190 // Authority #8 188 191 authInstance = new Authority(description:"Asset Manager", 189 authority:"ROLE_AssetManager")192 authority:"ROLE_AssetManager") 190 193 saveAndTest(authInstance) 191 194 192 195 // Authority #9 193 196 authInstance = new Authority(description:"Asset User", 194 authority:"ROLE_AssetUser") 197 authority:"ROLE_AssetUser") 198 saveAndTest(authInstance) 199 200 // Authority #10 201 authInstance = new Authority(description:"Production Manager", 202 authority:"ROLE_ProductionManager") 203 saveAndTest(authInstance) 204 205 // Authority #11 206 authInstance = new Authority(description:"Production User", 207 authority:"ROLE_ProductionUser") 195 208 saveAndTest(authInstance) 196 209 } … … 279 292 password:passwordEncoded) 280 293 saveAndTest(personInstance) 281 personInstance.addToAuthorities(Authority.get(2)) 282 personInstance.addToAuthorities(Authority.get(3)) 283 personInstance.addToPersonGroups(PersonGroup.get(5)) 294 personInstance.addToAuthorities(Authority.get(2)) // ROLE_Manager. 295 personInstance.addToAuthorities(Authority.get(3)) // ROLE_AppUser. 284 296 285 297 //Person #4 … … 290 302 password:passwordEncoded) 291 303 saveAndTest(personInstance) 292 personInstance.addToAuthorities(Authority.get(3)) 293 personInstance.addToAuthorities(Authority.get(5)) 294 personInstance.addToAuthorities(Authority.get(7)) 295 personInstance.addToAuthorities(Authority.get(9)) 304 personInstance.addToAuthorities(Authority.get(3)) // ROLE_AppUser. 305 personInstance.addToAuthorities(Authority.get(5)) // ROLE_TaskManager. 306 personInstance.addToAuthorities(Authority.get(7)) // ROLE_InventoryUser. 307 personInstance.addToAuthorities(Authority.get(9)) // ROLE_AssetUser. 296 308 personInstance.addToPersonGroups(PersonGroup.get(1)) 297 309 … … 323 335 324 336 //Person #7 325 personInstance = new Person(loginName:" mann",337 personInstance = new Person(loginName:"production manager", 326 338 firstName:"Production", 327 lastName:"Man n",339 lastName:"Manager", 328 340 pass:passClearText, 329 341 password:passwordEncoded) 330 342 saveAndTest(personInstance) 331 personInstance.addToAuthorities(Authority.get(3)) 332 personInstance.addToAuthorities(Authority.get( 5))343 personInstance.addToAuthorities(Authority.get(3)) // ROLE_AppUser. 344 personInstance.addToAuthorities(Authority.get(10)) // ROLE_ProductionManager. 333 345 personInstance.addToPersonGroups(PersonGroup.get(3)) 334 346 335 //Person #7 347 //Person #8 348 personInstance = new Person(loginName:"production", 349 firstName:"Production", 350 lastName:"User", 351 pass:passClearText, 352 password:passwordEncoded) 353 saveAndTest(personInstance) 354 personInstance.addToAuthorities(Authority.get(3)) // ROLE_AppUser. 355 personInstance.addToAuthorities(Authority.get(11)) // ROLE_ProductionUser. 356 personInstance.addToPersonGroups(PersonGroup.get(3)) 357 358 //Person #9 336 359 personInstance = new Person(loginName:"testmanager", 337 360 firstName:"Test", … … 340 363 password:passwordEncoded) 341 364 saveAndTest(personInstance) 342 personInstance.addToAuthorities(Authority.get(3)) 343 personInstance.addToAuthorities(Authority.get(4)) 344 personInstance.addToAuthorities(Authority.get(6)) 345 personInstance.addToAuthorities(Authority.get(8)) 365 personInstance.addToAuthorities(Authority.get(3)) // ROLE_AppUser. 366 personInstance.addToAuthorities(Authority.get(4)) // ROLE_TaskManager. 367 personInstance.addToAuthorities(Authority.get(6)) // ROLE_InventoryManager. 368 personInstance.addToAuthorities(Authority.get(8)) // ROLE_AssetManager. 346 369 personInstance.addToPersonGroups(PersonGroup.get(3)) 347 370 } … … 621 644 } 622 645 646 def createDemoProductionReference() { 647 648 // ProductionReference 649 def productionReferenceInstance 650 651 // ProductionReference #1 652 productionReferenceInstance = new ProductionReference(name: "Monday Production") 653 saveAndTest(productionReferenceInstance) 654 655 // ProductionReference #2 656 productionReferenceInstance = new ProductionReference(name: "Tuesday Production") 657 saveAndTest(productionReferenceInstance) 658 } 659 623 660 /********************* 624 661 START OF TASK -
trunk/grails-app/services/TaskService.groovy
r418 r431 688 688 } 689 689 690 def productionReference 691 if(params.entryFault.productionReference.id.isLong()) 692 productionReference = ProductionReference.get(params.entryFault.productionReference.id.toLong()) 693 690 694 def faultParams = [task: result.taskInstance, 691 695 entryType: EntryType.get(1), 692 696 comment: params.entryFault.comment, 697 productionReference: productionReference, 693 698 durationHour: params.entryFault.durationHour, 694 699 durationMinute: params.entryFault.durationMinute]
Note: See TracChangeset
for help on using the changeset viewer.