Implements issue #1061, allow org admins (or higher) job delete

This commit is contained in:
Wayne Witzel III 2016-03-18 10:28:38 -04:00
parent 3a11bca31f
commit b5ca6b891b

View File

@ -883,7 +883,10 @@ class JobAccess(BaseAccess):
return obj.status == 'new' and self.can_read(obj) and self.can_add(data)
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):
self.check_license()