code: def _has_role(self, organisation_id, role):
          
          if organisation_id is None:
              return False
  
          try:
              org = self.organisations.get(organisation_id, {})
              user_role = org.get('role')
              state = org.get('state')
          except AttributeError:
              return False
  
          return user_role == role.value and state == State.approved.name
docs: Check the user's role for the organisation