def canInvite(session):
    """ Determine if the user can edit sources in this org """
    if session.user['userlevel'] == 'admin':
        return True
    
    dOrg = session.user['defaultOrganisation'] or "apache"
    if session.DB.ES.exists(index=session.DB.dbname, doc_type="organisation", id= dOrg):
        xorg = session.DB.ES.get(index=session.DB.dbname, doc_type="organisation", id= dOrg)['_source']
        if session.user['email'] in xorg['admins']:
            return True