def get_application_access_for_domain(domain):
    return ApplicationAccess.view(
        'by_domain_doc_type_date/view',
        startkey=[domain, 'ApplicationAccess'],
        endkey=[domain, 'ApplicationAccess', {}],
        include_docs=True,
        reduce=False,
    ).first()
there should only be one ApplicationAccess per domain,
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/cloudcare/dbaccessors.py/get_application_access_for_domain