Update inventory script visibility access level

admin roles on inv scripts can now see the actual script contents.  Read
role doesn't convey that capability.

This should be pretty similar to before from a read_role
perspective... it now allows more folks to see the script contents
This commit is contained in:
Matthew Jones 2016-06-22 13:47:00 -04:00
parent aad4da3c39
commit 87f1f6f8e6

View File

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