1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 01:21:21 +03:00

fix event querysets for non superusers

This commit is contained in:
AlanCoding 2018-04-20 11:44:52 -04:00
parent 60e3dfe22c
commit 6cb237d5d9
No known key found for this signature in database
GPG Key ID: FD2C3C012A72926B

View File

@ -2087,7 +2087,7 @@ class ProjectUpdateEventAccess(BaseAccess):
def filtered_queryset(self): def filtered_queryset(self):
return self.model.objects.filter( return self.model.objects.filter(
Q(project_update__in=ProjectUpdate.accessible_pk_qs(self.user, 'read_role'))) Q(project_update__project__in=Project.accessible_pk_qs(self.user, 'read_role')))
def can_add(self, data): def can_add(self, data):
return False return False
@ -2108,7 +2108,7 @@ class InventoryUpdateEventAccess(BaseAccess):
def filtered_queryset(self): def filtered_queryset(self):
return self.model.objects.filter( return self.model.objects.filter(
Q(inventory_update__in=InventoryUpdate.accessible_pk_qs(self.user, 'read_role'))) Q(inventory_update__inventory_source__inventory__in=Inventory.accessible_pk_qs(self.user, 'read_role')))
def can_add(self, data): def can_add(self, data):
return False return False