Merge pull request #3225 from AlanCoding/3188_cheap

The easy option to show inventory scripts to org auditors
This commit is contained in:
Alan Rominger 2016-08-10 16:10:08 -04:00 committed by GitHub
commit 9ab3aae59d

View File

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