mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
enh: ability to set chat controls permissions
This commit is contained in:
parent
56f57928c2
commit
90d4bedae8
@ -30,6 +30,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{#if $user.role === 'admin' || $user.permissions.chat?.controls}
|
||||||
<div class=" dark:text-gray-200 text-sm font-primary py-0.5 px-0.5">
|
<div class=" dark:text-gray-200 text-sm font-primary py-0.5 px-0.5">
|
||||||
{#if chatFiles.length > 0}
|
{#if chatFiles.length > 0}
|
||||||
<Collapsible title={$i18n.t('Files')} open={true} buttonClassName="w-full">
|
<Collapsible title={$i18n.t('Files')} open={true} buttonClassName="w-full">
|
||||||
@ -90,4 +91,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</Collapsible>
|
</Collapsible>
|
||||||
</div>
|
</div>
|
||||||
|
{:else}
|
||||||
|
<div class="text-sm dark:text-gray-300 text-center py-2 px-10">
|
||||||
|
{$i18n.t('You do not have permission to access this feature.')}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
@ -114,7 +114,7 @@
|
|||||||
<hr class="border-black/5 dark:border-white/5 my-1" />
|
<hr class="border-black/5 dark:border-white/5 my-1" />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if $config?.features?.enable_web_search}
|
{#if $config?.features?.enable_web_search && ($user.role === 'admin' || $user.permissions.features?.web_search)}
|
||||||
<button
|
<button
|
||||||
class="flex w-full justify-between gap-2 items-center px-3 py-2 text-sm font-medium cursor-pointer rounded-xl"
|
class="flex w-full justify-between gap-2 items-center px-3 py-2 text-sm font-medium cursor-pointer rounded-xl"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
|
@ -114,7 +114,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
</Menu>
|
</Menu>
|
||||||
{:else if $mobile}
|
{:else if $mobile && ($user.role === 'admin' || $user.permissions.chat?.controls)}
|
||||||
<Tooltip content={$i18n.t('Controls')}>
|
<Tooltip content={$i18n.t('Controls')}>
|
||||||
<button
|
<button
|
||||||
class=" flex cursor-pointer px-2 py-2 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-850 transition"
|
class=" flex cursor-pointer px-2 py-2 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-850 transition"
|
||||||
@ -130,7 +130,7 @@
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if !$mobile}
|
{#if !$mobile && ($user.role === 'admin' || $user.permissions.chat?.controls)}
|
||||||
<Tooltip content={$i18n.t('Controls')}>
|
<Tooltip content={$i18n.t('Controls')}>
|
||||||
<button
|
<button
|
||||||
class=" flex cursor-pointer px-2 py-2 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-850 transition"
|
class=" flex cursor-pointer px-2 py-2 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-850 transition"
|
||||||
|
Loading…
Reference in New Issue
Block a user