backend/puzzle/permissions/post.py
def has_object_permission(self, request, view, obj):
        """
        Admin can do anything except modify comment.
        """
        try:
            account = Account.objects.get(user__id=request.user.id)
            if account.profile == "reg":
                return True
            return request.user.id == obj.author_id or request.method in permissions.SAFE_METHODS
        except Account.DoesNotExist:
            return request.method in permissions.SAFE_METHODS

        Admin can do anything except modify comment.
        
Admin can do anything except modify comment.
Admin can do anything except modify comment .
def has_object_permission(self, request, view, obj):
        try:
            account = Account.objects.get(user__id=request.user.id)
            if account.profile == "reg":
                return True
            return request.user.id == obj.author_id or request.method in permissions.SAFE_METHODS
        except Account.DoesNotExist:
            return request.method in permissions.SAFE_METHODS
def has_object_permission ( self , request , view , obj ) : try : account = Account . objects . get ( user__id = request . user . id ) if account . profile == "reg" : return True return request . user . id == obj . author_id or request . method in permissions . SAFE_METHODS except Account . DoesNotExist : return request . method in permissions . SAFE_METHODS
Admin can do anything except modify comment.
Admin can do anything except modify comment .
"""
        Admin can do anything except modify comment.
        """
self
request
view
obj