diff --git a/Makefile b/Makefile index c539cf9fd5..0d0217b339 100644 --- a/Makefile +++ b/Makefile @@ -368,7 +368,7 @@ test_unit: # Run all API unit tests with coverage enabled. test_coverage: - py.test --create-db --cov=awx --cov-report=xml --junitxml=./reports/junit.xml awx/main/tests awx/api/tests awx/fact/tests + py.test --create-db --cov=awx --cov-report=xml --junitxml=./reports/junit.xml awx/main/tests awx/api/tests # Output test coverage as HTML (into htmlcov directory). coverage_html: diff --git a/awx/main/access.py b/awx/main/access.py index b44c8fa577..33e389fab3 100644 --- a/awx/main/access.py +++ b/awx/main/access.py @@ -838,7 +838,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()