code: def _check_membership_with_mid(self, request, mid):
      try:
          exp_obj = Experiment.objects.get(id=mid)
          Membership.objects.get(
              user=request.user, project=exp_obj.project.id
          )
      except (Membership.DoesNotExist, Experiment.DoesNotExist):
          return False
  
      return True
  
imports: from rest_framework.permissions import BasePermission
  from modelchimp.models.membership import Membership
  from modelchimp.models.experiment import Experiment
label_desc: Use image node_id 2 for calling the HasProjectMembership obj's underlying member method code with example usage: obj._check_membership_with_mid(request, mid) and returns: True, False