fix: enforce Allow Chat Valves permission in integrations menu (#20691)

- The "Allow Chat Valves" permission was only hiding valves in the Chat Controls sidebar, but users could still bypass this by accessing valves through the integrations menu in the chat input field. This fix adds the permission check to hide Valves buttons for both tools and filters/functions in the integrations menu.
This commit is contained in:
G30
2026-01-22 16:25:00 -05:00
committed by GitHub
parent 3bec320bb9
commit 443908b14c

View File

@@ -178,7 +178,7 @@
</div>
</div>
{#if filter?.has_user_valves}
{#if filter?.has_user_valves && ($user?.role === 'admin' || ($user?.permissions?.chat?.valves ?? true))}
<div class=" shrink-0">
<Tooltip content={$i18n.t('Valves')}>
<button
@@ -371,7 +371,7 @@
</div>
</div>
{#if tools[toolId]?.has_user_valves}
{#if tools[toolId]?.has_user_valves && ($user?.role === 'admin' || ($user?.permissions?.chat?.valves ?? true))}
<div class=" shrink-0">
<Tooltip content={$i18n.t('Valves')}>
<button