Ignore:
Timestamp:
Jul 15, 2010, 4:22:04 PM (9 years ago)
Author:
gav
Message:

Check for authorisation on recurring tasks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/services/InventoryMovementService.groovy

    r407 r631  
    44
    55    def authService
     6    def authenticateService
    67
    78    def reverseMove(params) {
     
    3435                if(result.inventoryMovementInstance.task?.taskStatus?.id == 3)
    3536                    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
    3644            }
    3745
     
    95103                if(result.inventoryMovementInstance.task.taskStatus.id == 3)
    96104                    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                }
    97111            }
    98112
Note: See TracChangeset for help on using the changeset viewer.