Allow anyone who can read an inventory to see adhoc command run against said inventory

This commit is contained in:
Akita Noek 2016-07-06 14:23:42 -04:00
parent 9ffb5261cd
commit 0e7ed8428d

View File

@ -1076,7 +1076,7 @@ class AdHocCommandAccess(BaseAccess):
return qs.all()
credential_ids = set(self.user.get_queryset(Credential).values_list('id', flat=True))
inventory_qs = Inventory.accessible_objects(self.user, 'adhoc_role')
inventory_qs = Inventory.accessible_objects(self.user, 'read_role')
return qs.filter(credential_id__in=credential_ids,
inventory__in=inventory_qs)