diff --git a/rest_access_policy/access_view_set_mixin.py b/rest_access_policy/access_view_set_mixin.py index a61e52a..b22d1d6 100644 --- a/rest_access_policy/access_view_set_mixin.py +++ b/rest_access_policy/access_view_set_mixin.py @@ -26,3 +26,10 @@ def __init__(self, *args, **kwargs): def finalize_response(self, request, response, *args, **kwargs) -> Response: response = super().finalize_response(request, response, *args, **kwargs) return response + + def get_queryset(self): + queryset = super().get_queryset() + scope_queryset = self.access_policy.scope_queryset(self.request, queryset) + if scope_queryset.exists(): + return scope_queryset + return queryset