mirror of
https://github.com/ansible/awx.git
synced 2026-05-17 22:37:41 -02:30
allow WFJT admins to cancel scheduled jobs
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user