🔒️(back) restrict access to favorite_list endpoint

favorite_list endpoint is accessible to anonymous user. This lead to an
error 500. This endpoint should be accessible only to authenticated
users.
This commit is contained in:
Manuel Raynaud
2025-03-06 15:21:49 +01:00
parent 38eb6d45b7
commit 0cabb655ad
3 changed files with 80 additions and 0 deletions

View File

@@ -591,6 +591,7 @@ class DocumentViewSet(
@drf.decorators.action(
detail=False,
methods=["get"],
permission_classes=[permissions.IsAuthenticated],
)
def favorite_list(self, request, *args, **kwargs):
"""Get list of favorite documents for the current user."""