diff --git a/netbox_topology_views/api/views.py b/netbox_topology_views/api/views.py index 6741dd8..91b51bf 100644 --- a/netbox_topology_views/api/views.py +++ b/netbox_topology_views/api/views.py @@ -98,7 +98,7 @@ class ExportTopoToXML(PermissionRequiredMixin, ViewSet): def list(self, request): self.filterset = DeviceFilterSet - self.queryset = Device.objects.all().select_related( + self.queryset = Device.objects.restrict(request.user, 'view').select_related( "device_type", "role" ) self.queryset = self.filterset(request.GET, self.queryset).qs diff --git a/netbox_topology_views/views.py b/netbox_topology_views/views.py index a2b4978..b347e2a 100644 --- a/netbox_topology_views/views.py +++ b/netbox_topology_views/views.py @@ -697,7 +697,7 @@ class TopologyHomeView(PermissionRequiredMixin, View): def get(self, request): self.filterset = DeviceFilterSet - self.queryset = Device.objects.all().select_related( + self.queryset = Device.objects.restrict(request.user, 'view').select_related( "device_type", "role" ) self.queryset = self.filterset(request.GET, self.queryset).qs