From b5ca6b891b20801dd18bfb204efa069480b4e7e9 Mon Sep 17 00:00:00 2001 From: Wayne Witzel III Date: Fri, 18 Mar 2016 10:28:38 -0400 Subject: [PATCH 1/2] Implements issue #1061, allow org admins (or higher) job delete --- awx/main/access.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/awx/main/access.py b/awx/main/access.py index 9d67dd5295..6a5c4c10ca 100644 --- a/awx/main/access.py +++ b/awx/main/access.py @@ -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() From 99ca2efc4fe20d00ae705b2925ea6f51b17cc7d9 Mon Sep 17 00:00:00 2001 From: Wayne Witzel III Date: Tue, 22 Mar 2016 09:31:11 -0400 Subject: [PATCH 2/2] Update Makefile, no more fact/tests --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: