Skip to content

Commit

Permalink
feat: изменены пермишены и добавлен сериализатор.
Browse files Browse the repository at this point in the history
  • Loading branch information
menma331 committed Feb 19, 2024
1 parent d8a3d1b commit 3c636a9
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion delivers/views/vehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,21 @@ class VehicleViewSet(CRDListViewSet):

permission_classes = (permissions.IsAuthenticated,)

multi_permission_classes = {
'create': (permissions.IsAdminUser,),
'retrieve': (permissions.AllowAny,),
'destroy': (permissions.IsAdminUser,),
'list': (permissions.AllowAny,)

}

http_method_names = ('get', 'post', 'delete')

serializer_class = vehicle_s.VehicleListSerializer

multi_serializer_class = {
'create': vehicle_s.VehicleCreateSerializer,
'retrieve': vehicle_s.VehicleRetrieveSerializer,
'destroy': vehicle_s.VehicleDeleteSerializer
'destroy': vehicle_s.VehicleDeleteSerializer,
'list': vehicle_s.VehicleListSerializer
}

0 comments on commit 3c636a9

Please sign in to comment.