<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _has_role(self, organisation_id, role):
 """Check the user's role for the organisation"""

        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