def null_group_membership(username, group):
    """Default group membership test.
    Gives HOST permission to all users and MOD permission to those
    with dpauth.moderator Django permission.

    Custom implementations can delegate to this one if group is blank.

    Parameters:
    username -- the Username instance or None if this is a guest user
    group    -- group name or None if no group was specified
    """

    if group:
        return None

    flags = ['HOST']
    if username and username.is_mod and username.user.has_perm('dpauth.moderator'):
        flags.append('MOD')

    return {
        'member': False,
        'flags': flags,
        }