From ed5de96d1d445f4946e8219743b865cb18bb906b Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 7 May 2025 02:41:33 +0400 Subject: [PATCH] fix: tool servers ui settings can be bypassed with search --- src/lib/components/chat/SettingsModal.svelte | 32 ++++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/src/lib/components/chat/SettingsModal.svelte b/src/lib/components/chat/SettingsModal.svelte index ed2e9eb7a..08b7899f7 100644 --- a/src/lib/components/chat/SettingsModal.svelte +++ b/src/lib/components/chat/SettingsModal.svelte @@ -123,16 +123,28 @@ 'alwaysonwebsearch' ] }, - { - id: 'connections', - title: 'Connections', - keywords: [] - }, - { - id: 'tools', - title: 'Tools', - keywords: [] - }, + ...($user?.role === 'admin' || + ($user?.role === 'user' && $config?.features?.enable_direct_connections) + ? [ + { + id: 'connections', + title: 'Connections', + keywords: [] + } + ] + : []), + + ...($user?.role === 'admin' || + ($user?.role === 'user' && $user?.permissions?.features?.direct_tool_servers) + ? [ + { + id: 'tools', + title: 'Tools', + keywords: [] + } + ] + : []), + { id: 'personalization', title: 'Personalization',