Add normal permissions to DRF root
This commit is contained in:
+4
-1
@@ -9,7 +9,7 @@ from django.views.decorators.http import require_http_methods
|
||||
# from django.contrib.auth.decorators import permission_required, login_required
|
||||
# from django.conf import settings
|
||||
# from django.utils import timezone
|
||||
from rest_framework import viewsets
|
||||
from rest_framework import viewsets, routers
|
||||
from rest_framework.permissions import IsAuthenticatedOrReadOnly
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.reverse import reverse
|
||||
@@ -23,7 +23,10 @@ from webapp.models import Event, SignupForm, Signup, TemplateQuestion, Feed,\
|
||||
from webapp.serializers import *
|
||||
from members.views.utils import *
|
||||
|
||||
|
||||
# -- REST API -- #
|
||||
class RootView(routers.APIRootView):
|
||||
permission_classes = [IsAuthenticatedOrReadOnly]
|
||||
|
||||
|
||||
class EventViewSet(viewsets.ModelViewSet):
|
||||
|
||||
Reference in New Issue
Block a user