Commit 2e922859 authored by Luis García's avatar Luis García
Browse files

Permissions changes

parent 6247d53c
......@@ -49,6 +49,7 @@ from core.views.social_auth import FacebookLogin, TwitterLogin, FacebookConnect,
urlpatterns = api_patterns[0]
urlpatterns += [
path('admin/', include('django.contrib.auth.urls')),
url(r'^token-auth/', obtain_jwt_token),
url(r'^token-refresh/', refresh_jwt_token),
url(r'^token-verify/', verify_jwt_token),
......
......@@ -146,7 +146,7 @@ class ResponseViewSet(DestroyToInvisibleMixin, OwnerFieldMixin, ModelViewSet):
############################################################
class AnswerViewSet(DestroyToInvisibleMixin, ModelViewSet):
#Everyone can read, just staff user can modificate
permission_classes = (AnswerPermissions,)
permission_classes = (IsAuthenticated,)
queryset = Answer.objects.filter(visible=True)
serializer_class = AnswerSerializer
#Enable filter by code
......@@ -177,7 +177,7 @@ class AnswerViewSet(DestroyToInvisibleMixin, ModelViewSet):
############################################################
class SpatialInputViewSet(DestroyToInvisibleMixin, ModelViewSet):
#Everyone can read, just staff user can modificate
permission_classes = (SpatialInputPermissions,)
permission_classes = (IsAuthenticated,)
queryset = SpatialInput.objects.filter(visible=True)
serializer_class = SpatialInputSerializer
#Enable filter by code
......@@ -189,7 +189,7 @@ class SpatialInputViewSet(DestroyToInvisibleMixin, ModelViewSet):
############################################################
class SpatialInputAnswerViewSet(mixins.ListModelMixin, GenericViewSet):
#Everyone can read, just staff user can modificate
permission_classes = (IsAdminUser,)
#permission_classes = (IsAdminUser,)
queryset = Answer.objects.filter(visible=True, question__type='cm')
serializer_class = SpatialInputAnswerSerializer
#Enable filter
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment