1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

ensure system admin/auditor can see orphan inventory scripts

This commit is contained in:
Wayne Witzel III 2016-07-14 11:16:16 -04:00 committed by John Mitchell
parent f0bfcd78d9
commit a801ee7d52

View File

@ -1283,7 +1283,9 @@ class CustomInventoryScriptSerializer(BaseSerializer):
if obj is None:
return ret
request = self.context.get('request', None)
if request.user not in obj.admin_role:
if request.user not in obj.admin_role and \
not request.user.is_superuser and \
not request.user.is_system_auditor:
ret['script'] = None
return ret