allow WFJT admins to cancel scheduled jobs

This commit is contained in:
AlanCoding
2017-10-02 10:25:49 -04:00
parent ca4a1f37cd
commit 681770e25a
2 changed files with 8 additions and 1 deletions

View File

@@ -1841,7 +1841,9 @@ class WorkflowJobAccess(BaseAccess):
def can_cancel(self, obj):
if not obj.can_cancel:
return False
return self.can_delete(obj) or self.user == obj.created_by
if self.user == obj.created_by or self.can_delete(obj):
return True
return obj.workflow_job_template is not None and self.user in obj.workflow_job_template.admin_role
class AdHocCommandAccess(BaseAccess):