Skip to content

Commit

Permalink
11
Browse files Browse the repository at this point in the history
  • Loading branch information
fabilya committed Oct 1, 2023
1 parent ea99fe9 commit 6dd7e9c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class RecipeViewSet(
queryset = Recipe.objects.all()
filter_backends = (DjangoFilterBackend,)
filterset_class = RecipeFilter
permission_classes = OwnerUserOrReadOnly

def get_permissions(self):

Expand All @@ -60,7 +61,7 @@ def get_permissions(self):
'shopping_cart': [permissions.IsAuthenticated()],
'download_shopping_cart': [permissions.IsAuthenticated()],
'list': [permissions.AllowAny()],
'retrieve': [permissions.AllowAny()],
'retrieve': [OwnerUserOrReadOnly],
}
return permissions_dict.get(
self.action, [permissions.IsAuthenticated()]
Expand Down

0 comments on commit 6dd7e9c

Please sign in to comment.