Merge pull request #2820 from anoek/2806

Allow anyone who can read an inventory to see adhoc command run against said inventory
This commit is contained in:
Akita Noek 2016-07-07 09:09:16 -04:00 committed by GitHub
commit b6ec87f18a

View File

@ -1087,7 +1087,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)