Skip to content

Commit

Permalink
added restrict to query (#522)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattieserver authored Jul 4, 2024
1 parent 2600209 commit 142de46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion netbox_topology_views/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion netbox_topology_views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 142de46

Please sign in to comment.