Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
hackinscience
hkis-website
Commits
d85c209b
Commit
d85c209b
authored
Jan 19, 2019
by
Julien Palard
Browse files
Unauthenticated users don't have answers.
parent
7dc3fdd3
Changes
1
Hide whitespace changes
Inline
Side-by-side
website/api.py
View file @
d85c209b
...
...
@@ -24,6 +24,8 @@ class AnswerPermission(permissions.BasePermission):
def
has_permission
(
self
,
request
,
view
):
"""Authenticated users can create (POST) but not edit.
"""
if
not
request
.
user
.
is_authenticated
:
return
False
if
request
.
user
.
is_staff
:
return
True
if
request
.
method
==
"POST"
and
request
.
user
.
is_authenticated
:
...
...
Write
Preview
Supports
Markdown
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