diff --git a/src/lib/components/chat/MessageInput/InputMenu.svelte b/src/lib/components/chat/MessageInput/InputMenu.svelte index 20b297eb3..3c8eaf008 100644 --- a/src/lib/components/chat/MessageInput/InputMenu.svelte +++ b/src/lib/components/chat/MessageInput/InputMenu.svelte @@ -48,6 +48,9 @@ init(); } + let fileUploadEnabled = true; + $: fileUploadEnabled = $user.role === 'admin' || $user?.permissions?.chat?.file_upload; + const init = async () => { if ($_tools === null) { await _tools.set(await getTools(localStorage.token)); @@ -166,26 +169,44 @@ {/if} {#if !$mobile} - { - screenCaptureHandler(); - }} + - - {$i18n.t('Capture')} - + { + if (fileUploadEnabled) { + screenCaptureHandler(); + } + }} + > + + {$i18n.t('Capture')} + + {/if} - { - uploadFilesHandler(); - }} + - - {$i18n.t('Upload Files')} - + { + if (fileUploadEnabled) { + uploadFilesHandler(); + } + }} + > + + {$i18n.t('Upload Files')} + + {#if $config?.features?.enable_google_drive_integration}