def has_org_role(role_header=None, org_governance_name=None, role_name=None):
    '''
    Check the ion-actor-roles message header to see if this actor has the specified role in the specified Org.
    Parameter role_name can be a string with the name of a user role or a list of user role names, which will
    recursively call this same method for each role name in the list until one is found or the list is exhausted.
    @param role_header:
    @param org_name:
    @param role_name:
    @return:
    '''
    if role_header is None or org_governance_name is None or role_name is None:
        raise BadRequest("One of the parameters to this method are not set")

    if isinstance(role_name, list):
        for role in role_name:
            if has_org_role(role_header, org_governance_name, role):
                return True
    else:
        if role_header.has_key(org_governance_name):
            if role_name in role_header[org_governance_name]:
                return True

    return False
dataset/ETHPy150Open ooici/pyon/pyon/core/governance/__init__.py/has_org_role/original