Commit d85c209b authored by Julien Palard's avatar Julien Palard
Browse files

Unauthenticated users don't have answers.

parent 7dc3fdd3
......@@ -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:
......
Supports Markdown
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