def METHOD_NAME(self):
    invitation = self.object
    user = self.request.user
    if invitation.user:
        if not user.is_authenticated:
            raise PermissionDenied
        if invitation.user != user:
            raise Http404