from rest_framework import permissions


class IsAdminOrReadOnly(permissions.BasePermission):
    def has_permission(self, request, view):
        if request.method in permissions.SAFE_METHODS:
            return True
        return request.user.is_staff

    def has_object_permission(self, request, view, obj):
        if request.method in permissions.SAFE_METHODS:
            return True
        return request.user.is_staff

class IsRegistrantOrReadOnly(permissions.BasePermission):
    def has_permission(self, request, view):
        if request.method in permissions.SAFE_METHODS:
            return True

    def has_object_permission(self, request, view, obj):
        return obj.user == request.user
@@ -423,16 +423,17 @@
 _staff%0A%0A
+%0A
 class Is
@@ -605,16 +605,152 @@
 urn True
+%0A        elif request.user.is_authenticated and request.method == 'POST':%0A            return True%0A        else:%0A            return False
 %0A%0A    de
@@ -792,32 +792,32 @@
 st, view, obj):%0A
-
         return o
@@ -827,20 +827,21 @@
 user == request.user
+%0A

fix registration permissions