From c6925ca8b47d8fdaded7d530b80580007a8e5730 Mon Sep 17 00:00:00 2001 From: Wayne Witzel III Date: Wed, 7 Jun 2017 11:44:15 -0400 Subject: [PATCH] Ensure the admin_role can always add an inventory_source. --- awx/main/access.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/awx/main/access.py b/awx/main/access.py index c44c05fc7c..9de72fb1fc 100644 --- a/awx/main/access.py +++ b/awx/main/access.py @@ -804,7 +804,8 @@ class InventorySourceAccess(BaseAccess): def can_add(self, data): if not data or 'inventory' not in data: - return False + return Organization.accessible_objects(self.user, 'admin_role').exists() + if not self.check_related('source_project', Project, data, role_field='use_role'): return False # Checks for admin or change permission on inventory.