require constituent resource access to relaunch WJ

This commit is contained in:
AlanCoding 2017-01-13 11:44:50 -05:00
parent d071b64f12
commit ba8f0ccff1
2 changed files with 2 additions and 10 deletions

View File

@ -1656,11 +1656,6 @@ class WorkflowJobAccess(BaseAccess):
if self.user not in wfjt.execute_role:
return False
# WFJT is valid base for WJ, launch permitted
last_modified = wfjt.nodes_last_modified()
if last_modified and obj.created > last_modified:
return True
# user's WFJT access doesn't guarentee permission to launch, introspect nodes
return self.can_recreate(obj)
@ -1672,8 +1667,8 @@ class WorkflowJobAccess(BaseAccess):
if not node_access.can_add({'reference_obj': node}):
wj_add_perm = False
if not wj_add_perm and self.save_messages:
self.messages['workflow_job_template'] = _('Template has been modified since job was launched, '
'and you do not have permission to its resources.')
self.messages['workflow_job_template'] = _('You do not have permission to the workflow job '
'resources required for relaunch.')
return wj_add_perm
def can_cancel(self, obj):

View File

@ -327,9 +327,6 @@ class WorkflowJobOptions(BaseModel):
new_workflow_job.copy_nodes_from_original(original=self)
return new_workflow_job
def nodes_last_modified(self):
return self.workflow_nodes.aggregate(models.Max('modified'))['modified__max']
class WorkflowJobTemplate(UnifiedJobTemplate, WorkflowJobOptions, SurveyJobTemplateMixin, ResourceMixin):
class Meta: