def METHOD_NAME(username):
    """
    :param username: Username to filter for
    :return: Dictionary that can be slotted into the ``__opts__`` structure for
        eauth that designates the user associated ACL
    Database records such as:
    ===========  ====================     =========
    username     minion_or_fn_matcher     minion_fn
    ===========  ====================     =========
    fred                                  test.ping
    fred         server1                  network.interfaces
    fred         server1                  raid.list
    fred         server2                  .*
    guru         .*
    smartadmin   server1                  .*
    ===========  ====================     =========
    Should result in an eauth config such as:
    .. code-block:: yaml
        fred:
          - test.ping
          - server1:
              - network.interfaces
              - raid.list
          - server2:
              - .*
        guru:
          - .*
        smartadmin:
          - server1:
            - .*
    """
    __django_auth_setup()
    if username is None:
        db_records = DJANGO_AUTH_CLASS.objects.all()
    else:
        db_records = DJANGO_AUTH_CLASS.objects.filter(user_fk__username=username)
    auth_dict = {}
    for a in db_records:
        if a.user_fk.username not in auth_dict:
            auth_dict[a.user_fk.username] = []
        if not a.minion_or_fn_matcher and a.minion_fn:
            auth_dict[a.user_fk.username].append(a.minion_fn)
        elif a.minion_or_fn_matcher and not a.minion_fn:
            auth_dict[a.user_fk.username].append(a.minion_or_fn_matcher)
        else:
            found = False
            for d in auth_dict[a.user_fk.username]:
                if isinstance(d, dict):
                    if a.minion_or_fn_matcher in d:
                        auth_dict[a.user_fk.username][a.minion_or_fn_matcher].append(
                            a.minion_fn
                        )
                        found = True
            if not found:
                auth_dict[a.user_fk.username].append(
                    {a.minion_or_fn_matcher: [a.minion_fn]}
                )
    log.debug("django auth_dict is %s", auth_dict)
    return auth_dict