Commit ce4d1aa2 authored by hypsug0's avatar hypsug0
Browse files

fix: view mixin permission

parent 761d8f68
......@@ -14,6 +14,7 @@ class StudyAuthMixin:
if not request.user.is_authenticated:
return redirect("%s?next=%s" % (reverse("auth_login"), request.path))
else:
self.obj = self.get_object()
loggeduser = request.user
if (
loggeduser.edit_all_data
......
from rest_framework.permissions import SAFE_METHODS, BasePermission
from rest_framework.permissions import BasePermission
class StudyDetailPermission(BasePermission):
......@@ -7,7 +7,7 @@ class StudyDetailPermission(BasePermission):
Assumes the model instance has an `owner` attribute.
"""
def has_object_permission(self, request, view, obj):
def has_object_permission(self, request, view, obj) -> bool:
# Read permissions are allowed to any request,
# so we'll always allow GET, HEAD or OPTIONS requests.
......
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