From a801ee7d525950e5c9cbcdb395950571019c9acd Mon Sep 17 00:00:00 2001 From: Wayne Witzel III Date: Thu, 14 Jul 2016 11:16:16 -0400 Subject: [PATCH] ensure system admin/auditor can see orphan inventory scripts --- awx/api/serializers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/awx/api/serializers.py b/awx/api/serializers.py index 1487fe17e3..679d23aeee 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -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