def auth_is_anon_user(context):
    """ Is this an anonymous user?
        eg Not logged in if a web request and not user defined in context
        if logic functions called directly

        See ckan/lib/base.py:232 for pylons context object logic
    """
    context_user = context.get('user')
    is_anon_user = not bool(context_user)
    return is_anon_user
