Changeset 631 for trunk/grails-app
- Timestamp:
- Jul 15, 2010, 4:22:04 PM (14 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/i18n/messages.properties
r622 r631 136 136 task.operationNotPermittedOnCompleteTask=This operation is not permitted on a complete task. 137 137 task.operationNotPermittedOnTaskInTrash=This operation is not permitted on a task that is in the trash. 138 task.operationNotPermittedOnRecurringTaskWithoutAuth=This operation is not permitted on a recurring task without authorisation. 138 139 task.failedToSave=Could not complete operation, task failed to save. 139 140 task.modifications.failedToSave=Could not complete operation, as task modification record failed to save. -
trunk/grails-app/services/InventoryMovementService.groovy
r407 r631 4 4 5 5 def authService 6 def authenticateService 6 7 7 8 def reverseMove(params) { … … 34 35 if(result.inventoryMovementInstance.task?.taskStatus?.id == 3) 35 36 return fail(field:"task", code:"task.operationNotPermittedOnCompleteTask") 37 38 // Check for authorisation on recurring tasks. 39 if(result.inventoryMovementInstance.task?.taskRecurringSchedule) { 40 if(!authenticateService.ifAnyGranted('ROLE_AppAdmin,ROLE_Manager,ROLE_TaskManager,ROLE_InventoryManager')) 41 return fail(field:"task", code:"task.operationNotPermittedOnRecurringTaskWithoutAuth") 42 } 43 36 44 } 37 45 … … 95 103 if(result.inventoryMovementInstance.task.taskStatus.id == 3) 96 104 return fail(field:"task", code:"task.operationNotPermittedOnCompleteTask") 105 106 // Check for authorisation on recurring tasks. 107 if(result.inventoryMovementInstance.task.taskRecurringSchedule) { 108 if(!authenticateService.ifAnyGranted('ROLE_AppAdmin,ROLE_Manager,ROLE_TaskManager,ROLE_InventoryManager')) 109 return fail(field:"task", code:"task.operationNotPermittedOnRecurringTaskWithoutAuth") 110 } 97 111 } 98 112 -
trunk/grails-app/services/TaskService.groovy
r601 r631 11 11 def authService 12 12 def dateUtilService 13 def authenticateService 13 14 def assignedGroupService 14 15 def assignedPersonService … … 325 326 return fail(field:"task", code:"task.operationNotPermittedOnCompleteTask") 326 327 328 // Check for authorisation on recurring tasks. 329 if(taskInstance.taskRecurringSchedule) { 330 if(!authenticateService.ifAnyGranted('ROLE_AppAdmin,ROLE_Manager,ROLE_TaskManager')) 331 return fail(field:"task", code:"task.operationNotPermittedOnRecurringTaskWithoutAuth") 332 } 333 327 334 // If task status is "Not Started" and entry type is "Work Done" and time has been booked. 328 335 // Then we create the started modification and set task status. … … 379 386 } 380 387 388 // Check for authorisation on recurring tasks. 389 if(result.taskInstance.taskRecurringSchedule) { 390 if(!authenticateService.ifAnyGranted('ROLE_AppAdmin,ROLE_Manager,ROLE_TaskManager')) 391 return fail(field:"taskRecurringSchedule", code:"task.operationNotPermittedOnRecurringTaskWithoutAuth") 392 } 393 381 394 result.taskInstance.properties = params 382 395 … … 425 438 } 426 439 440 // Check for authorisation on recurring tasks. 441 if(result.taskInstance.taskRecurringSchedule) { 442 if(!authenticateService.ifAnyGranted('ROLE_AppAdmin,ROLE_Manager,ROLE_TaskManager')) 443 return fail(field:"taskRecurringSchedule", code:"task.operationNotPermittedOnRecurringTaskWithoutAuth") 444 } 445 427 446 result.taskInstance.taskStatus = TaskStatus.get(3) 428 447 result.taskInstance.attentionFlag = false … … 474 493 } 475 494 495 // Check for authorisation on recurring tasks. 496 if(result.taskInstance.taskRecurringSchedule) { 497 if(!authenticateService.ifAnyGranted('ROLE_AppAdmin,ROLE_Manager,ROLE_TaskManager')) 498 return fail(field:"taskRecurringSchedule", code:"task.operationNotPermittedOnRecurringTaskWithoutAuth") 499 } 500 476 501 result.taskInstance.attentionFlag = true 477 502 … … 520 545 } 521 546 547 // Check for authorisation on recurring tasks. 548 if(result.taskInstance.taskRecurringSchedule) { 549 if(!authenticateService.ifAnyGranted('ROLE_AppAdmin,ROLE_Manager,ROLE_TaskManager')) 550 return fail(field:"taskRecurringSchedule", code:"task.operationNotPermittedOnRecurringTaskWithoutAuth") 551 } 552 522 553 result.taskInstance.attentionFlag = false 523 554 … … 566 597 } 567 598 599 // Check for authorisation on recurring tasks. 600 if(result.taskInstance.taskRecurringSchedule) { 601 if(!authenticateService.ifAnyGranted('ROLE_AppAdmin,ROLE_Manager,ROLE_TaskManager')) 602 return fail(field:"taskRecurringSchedule", code:"task.operationNotPermittedOnRecurringTaskWithoutAuth") 603 } 604 568 605 def isInProgress = false 569 606 result.taskInstance.entries.each() { … … 621 658 } 622 659 660 // Check for authorisation on recurring tasks. 661 if(result.taskInstance.taskRecurringSchedule) { 662 if(!authenticateService.ifAnyGranted('ROLE_AppAdmin,ROLE_Manager,ROLE_TaskManager')) 663 return fail(field:"taskRecurringSchedule", code:"task.operationNotPermittedOnRecurringTaskWithoutAuth") 664 } 665 623 666 result.taskInstance.trash = true 624 667 result.taskInstance.attentionFlag = false … … 669 712 } 670 713 714 // Check for authorisation on recurring tasks. 715 if(result.taskInstance.taskRecurringSchedule) { 716 if(!authenticateService.ifAnyGranted('ROLE_AppAdmin,ROLE_Manager,ROLE_TaskManager')) 717 return fail(field:"taskRecurringSchedule", code:"task.operationNotPermittedOnRecurringTaskWithoutAuth") 718 } 719 671 720 result.taskInstance.trash = false 672 721 … … 715 764 } 716 765 766 // Check for authorisation on recurring tasks. 767 if(result.taskInstance.taskRecurringSchedule) { 768 if(!authenticateService.ifAnyGranted('ROLE_AppAdmin,ROLE_Manager,ROLE_TaskManager')) 769 return fail(field:"taskRecurringSchedule", code:"task.operationNotPermittedOnRecurringTaskWithoutAuth") 770 } 771 717 772 result.taskInstance.approved = true 718 773 … … 759 814 if(result.taskInstance.version > params.version.toLong()) 760 815 return fail(field:"version", code:"default.optimistic.locking.failure") 816 } 817 818 // Check for authorisation on recurring tasks. 819 if(result.taskInstance.taskRecurringSchedule) { 820 if(!authenticateService.ifAnyGranted('ROLE_AppAdmin,ROLE_Manager,ROLE_TaskManager')) 821 return fail(field:"taskRecurringSchedule", code:"task.operationNotPermittedOnRecurringTaskWithoutAuth") 761 822 } 762 823
Note: See TracChangeset
for help on using the changeset viewer.