from rest_framework import permissions class IsClubOwner(permissions.BasePermission): def has_object_permission(self, request, view, club): # Check if the request user is the owner of the club # print(club.creator.id) # print(request.user.id) return club.creator == request.user