public static Tristate call(CommandSender sender, String permission) {

        // calculate a default value based on the internal behaviour of
        // ConsoleCommandSender and UserConnection in order to replicate the
        // behaviour of CommandSender#hasPermission
        Tristate def = Tristate.UNDEFINED;
        if (!(sender instanceof ProxiedPlayer)) {
            // if not a ProxiedPlayer, assume it's console.
            def = Tristate.TRUE;
        } else if (sender.getPermissions().contains(permission)) {
            def = Tristate.TRUE;
        }

        return call(sender, permission, def);
    }
Copy of the internal BungeeCord PermissionCheckEvent, returning a tristate instead of a boolean.
bungee/src/main/java/me/lucko/luckperms/bungee/event/TristateCheckEvent.java