Ignore:
Timestamp:
Feb 16, 2011, 8:10:39 PM (13 years ago)
Author:
gav
Message:

Domain change, first draft of TaskProcedureRevisions.

File:
1 edited

Legend:

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

    r802 r809  
    188188    * Creates a subTask copying sane attributes from the parentTask unless otherwise specified in params.
    189189    * The targetStartDate and targetCompletionDate default to today since that is the sane thing to do.
    190     * The taskProcedure is only assigned to the sub task if supplied in params.
     190    * The taskProcedureRevision is only assigned to the sub task if supplied in params.
    191191    * The assignedPersons and assignedGroups are only added to the sub task if supplied in params.
    192192    * The positiveFault property is never set on the subTask.
     
    228228
    229229        // Supplied by recurring tasks.
    230         if(params.taskProcedure) p.taskProcedure = params.taskProcedure
     230        if(params.taskProcedureRevision) p.taskProcedureRevision = params.taskProcedureRevision
    231231        if(params.assignedGroups) p.assignedGroups = params.assignedGroups // Collection.
    232232        if(params.assignedPersons) p.assignedPersons = params.assignedPersons // Collection.
     
    691691            }
    692692
    693             // Check for taskProcedure using this task as linkedTask.
    694             if(result.taskInstance.taskProcedure?.linkedTask?.id == result.taskInstance.id)
    695                 return fail(field:"taskProcedure", code:"task.operationNotPermittedOnTaskLinkedToProcedure")
     693            // Check for taskProcedureRevision using this task as linkedTask.
     694            if(result.taskInstance.taskProcedureRevision?.linkedTask?.id == result.taskInstance.id) {
     695                if(!authenticateService.ifAnyGranted('ROLE_AppAdmin,ROLE_Manager,ROLE_TaskManager'))
     696                    return fail(field:"taskProcedureRevision", code:"task.operationNotPermittedOnTaskLinkedToProcedureWithoutAuth")
     697            }
    696698
    697699            // Check for Parent PM task type.
    698700            if(result.taskInstance.taskType.id == 6)
    699                 return fail(field:"taskProcedure", code:"task.operationNotPermittedOnParentPmTask")
     701                return fail(field:"taskType", code:"task.operationNotPermittedOnParentPmTask")
    700702
    701703            result.taskInstance.trash = true
Note: See TracChangeset for help on using the changeset viewer.