class UserViewSet(viewsets.ModelViewSet): permission_classes =[IsAuthenticated] if(permission_classes): http_method_names = ['post'] queryset = Documents.objects.all() serializer_class = DocumentSerializer i am trying like this my problem is unauth users can only access post method and auth users can access post,get,put methods
On Tue, Sep 10, 2019 at 5:47 PM siva gatti <siva.ga...@gmail.com> wrote: > unauthenticated users can only post but here they can do get ,delete and > update > > On Tue, Sep 10, 2019 at 5:34 PM Harrys Asimakopoulos <xarhs...@gmail.com> > wrote: > >> from rest_framework.permissions import AllowAny >> >> class UserViewSet(viewsets.ModelViewSet): >> permission_classes = [AllowAny,] >> queryset = Documents.objects.all() >> serializer_class = DocumentSerializer >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django REST framework" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-rest-framework+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-rest-framework/f9f13934-f4b1-4bf7-a675-fc606cf21908%40googlegroups.com >> <https://groups.google.com/d/msgid/django-rest-framework/f9f13934-f4b1-4bf7-a675-fc606cf21908%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "Django REST framework" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-rest-framework/CAA9F9ijJTZgogDyg3ufKw%2Bm5sXuHpRFREfrdYyNKHmk%3D%3DnC_hg%40mail.gmail.com.