mirror of
https://github.com/lemeow125/Django-NotesApp.git
synced 2025-05-16 19:48:11 +08:00
Added permissions to views
This commit is contained in:
parent
5b296ac367
commit
7ad2654b00
5 changed files with 18 additions and 1 deletions
|
@ -2,10 +2,11 @@ from rest_framework.permissions import IsAuthenticated
|
|||
from rest_framework import viewsets, generics
|
||||
from .serializers import NoteSerializer
|
||||
from .models import Note
|
||||
from permissions.permissions import IsOwner
|
||||
|
||||
|
||||
class NoteViewSet(viewsets.ModelViewSet):
|
||||
permission_classes = [IsAuthenticated]
|
||||
permission_classes = [IsOwner]
|
||||
serializer_class = NoteSerializer
|
||||
queryset = Note.objects.all()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue