1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 09:51:09 +03:00

Ensure the admin_role can always add an inventory_source.

This commit is contained in:
Wayne Witzel III 2017-06-07 11:44:15 -04:00
parent a183ed14f2
commit c6925ca8b4

View File

@ -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.