mirror of
https://github.com/ansible/awx.git
synced 2026-03-05 10:41:05 -03:30
Implements issue #1061, allow org admins (or higher) job delete
This commit is contained in:
@@ -883,7 +883,10 @@ class JobAccess(BaseAccess):
|
|||||||
return obj.status == 'new' and self.can_read(obj) and self.can_add(data)
|
return obj.status == 'new' and self.can_read(obj) and self.can_add(data)
|
||||||
|
|
||||||
def can_delete(self, obj):
|
def can_delete(self, obj):
|
||||||
return self.can_read(obj)
|
# Allow org admins and superusers to delete jobs
|
||||||
|
if self.user.is_superuser:
|
||||||
|
return True
|
||||||
|
return obj.inventory.accessible_by(self.user, ALL_PERMISSIONS)
|
||||||
|
|
||||||
def can_start(self, obj):
|
def can_start(self, obj):
|
||||||
self.check_license()
|
self.check_license()
|
||||||
|
|||||||
Reference in New Issue
Block a user