mirror of
https://github.com/ansible/awx.git
synced 2026-11-22 00:06:10 -03:30
orphan project protection in job delete access
This commit is contained in:
+2
-1
@@ -1081,7 +1081,8 @@ class JobAccess(BaseAccess):
|
||||
def can_delete(self, obj):
|
||||
if obj.inventory is not None and self.user in obj.inventory.organization.admin_role:
|
||||
return True
|
||||
if obj.project is not None and self.user in obj.project.organization.admin_role:
|
||||
if (obj.project is not None and obj.project.organization is not None and
|
||||
self.user in obj.project.organization.admin_role):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user