enh: image permissions

This commit is contained in:
Timothy Jaeryang Baek 2025-01-15 23:12:40 -08:00
parent 90d4bedae8
commit 92022dd81f
4 changed files with 5 additions and 5 deletions

View File

@ -30,7 +30,7 @@
</button>
</div>
{#if $user.role === 'admin' || $user.permissions.chat?.controls}
{#if $user.role === 'admin' || $user?.permissions.chat?.controls}
<div class=" dark:text-gray-200 text-sm font-primary py-0.5 px-0.5">
{#if chatFiles.length > 0}
<Collapsible title={$i18n.t('Files')} open={true} buttonClassName="w-full">

View File

@ -114,7 +114,7 @@
<hr class="border-black/5 dark:border-white/5 my-1" />
{/if}
{#if $config?.features?.enable_web_search && ($user.role === 'admin' || $user.permissions.features?.web_search)}
{#if $config?.features?.enable_web_search && ($user.role === 'admin' || $user?.permissions?.features?.web_search)}
<button
class="flex w-full justify-between gap-2 items-center px-3 py-2 text-sm font-medium cursor-pointer rounded-xl"
on:click={() => {

View File

@ -917,7 +917,7 @@
</button>
</Tooltip>
{#if $config?.features.enable_image_generation && !readOnly}
{#if $config?.features.enable_image_generation && ($user.role === 'admin' || $user?.permissions?.features?.image_generation) && !readOnly}
<Tooltip content={$i18n.t('Generate Image')} placement="bottom">
<button
class="{isLastMessage

View File

@ -114,7 +114,7 @@
</div>
</button>
</Menu>
{:else if $mobile && ($user.role === 'admin' || $user.permissions.chat?.controls)}
{:else if $mobile && ($user.role === 'admin' || $user?.permissions.chat?.controls)}
<Tooltip content={$i18n.t('Controls')}>
<button
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>
{/if}
{#if !$mobile && ($user.role === 'admin' || $user.permissions.chat?.controls)}
{#if !$mobile && ($user.role === 'admin' || $user?.permissions.chat?.controls)}
<Tooltip content={$i18n.t('Controls')}>
<button
class=" flex cursor-pointer px-2 py-2 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-850 transition"