소스 검색

fix: tool servers ui settings can be bypassed with search

Timothy Jaeryang Baek 11 달 전
부모
커밋
ed5de96d1d
1개의 변경된 파일22개의 추가작업 그리고 10개의 파일을 삭제
  1. 22 10
      src/lib/components/chat/SettingsModal.svelte

+ 22 - 10
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',