Skip to content

Commit 62193e0

Browse files
jonathan-longerpkilby
authored andcommitted
Add permissions to quickstart tutorial (#7113)
1 parent 5f3f2ef commit 62193e0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docs/tutorial/quickstart.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ Right, we'd better write some views then. Open `tutorial/quickstart/views.py` a
8585

8686
from django.contrib.auth.models import User, Group
8787
from rest_framework import viewsets
88+
from rest_framework import permissions
8889
from tutorial.quickstart.serializers import UserSerializer, GroupSerializer
8990

9091

@@ -94,6 +95,7 @@ Right, we'd better write some views then. Open `tutorial/quickstart/views.py` a
9495
"""
9596
queryset = User.objects.all().order_by('-date_joined')
9697
serializer_class = UserSerializer
98+
permission_classes = [permissions.IsAuthenticated]
9799

98100

99101
class GroupViewSet(viewsets.ModelViewSet):
@@ -102,6 +104,7 @@ Right, we'd better write some views then. Open `tutorial/quickstart/views.py` a
102104
"""
103105
queryset = Group.objects.all()
104106
serializer_class = GroupSerializer
107+
permission_classes = [permissions.IsAuthenticated]
105108

106109
Rather than write multiple views we're grouping together all the common behavior into classes called `ViewSets`.
107110

0 commit comments

Comments
 (0)