Merge branch 'rbac' of github.com:ansible/ansible-tower into rbac

This commit is contained in:
Akita Noek
2016-03-22 11:10:48 -04:00
2 changed files with 5 additions and 2 deletions

View File

@@ -849,7 +849,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()