mirror of
https://github.com/ansible/awx.git
synced 2026-03-21 10:57:36 -02:30
Merge pull request #1276 from wwitzel3/rbac
Implements issue #1061, allow org admins (or higher) job delete
This commit is contained in:
2
Makefile
2
Makefile
@@ -368,7 +368,7 @@ test_unit:
|
|||||||
|
|
||||||
# Run all API unit tests with coverage enabled.
|
# Run all API unit tests with coverage enabled.
|
||||||
test_coverage:
|
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).
|
# Output test coverage as HTML (into htmlcov directory).
|
||||||
coverage_html:
|
coverage_html:
|
||||||
|
|||||||
@@ -838,7 +838,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