Get user.organisations subresouces

def user_organisations_resource(doc):
    """Get user.organisations subresouces"""
    if doc.get('type') == 'user':
        for org_id, resource in doc.get('organisations', {}).items():
            resource['id'] = org_id
            resource['user_id'] = doc['_id']
            yield [doc['_id'], org_id], resource