Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Luis García
collabmap
Commits
2e922859
Commit
2e922859
authored
Feb 21, 2020
by
Luis García
Browse files
Permissions changes
parent
6247d53c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
collabmap/urls.py
collabmap/urls.py
+1
-0
surveys/views/api.py
surveys/views/api.py
+3
-3
No files found.
collabmap/urls.py
View file @
2e922859
...
...
@@ -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
),
...
...
surveys/views/api.py
View file @
2e922859
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment