fix(ui): gate all chat export formats by chat.export permission (#25914)
This commit is contained in:
2 files changed
+6
-4
No files matched your search
@@ -379,6 +379,7 @@
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
{#if $user?.role === 'admin' || ($user.permissions?.chat?.export ?? true)}
|
||||
<DropdownSub>
|
||||
<button
|
||||
slot="trigger"
|
||||
@@ -389,7 +390,7 @@
|
||||
|
||||
<div class="flex items-center">{$i18n.t('Download')}</div>
|
||||
</button>
|
||||
{#if $user?.role === 'admin' || ($user.permissions?.chat?.export ?? true)}
|
||||
|
||||
<button
|
||||
draggable="false"
|
||||
class="flex gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl select-none w-full"
|
||||
@@ -399,7 +400,7 @@
|
||||
>
|
||||
<div class="flex items-center line-clamp-1">{$i18n.t('Export chat (.json)')}</div>
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
<button
|
||||
draggable="false"
|
||||
class="flex gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl select-none w-full"
|
||||
@@ -420,6 +421,7 @@
|
||||
<div class="flex items-center line-clamp-1">{$i18n.t('PDF document (.pdf)')}</div>
|
||||
</button>
|
||||
</DropdownSub>
|
||||
{/if}
|
||||
|
||||
<button
|
||||
draggable="false"
|
||||
|
||||
@@ -313,6 +313,7 @@
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
{#if $user?.role === 'admin' || ($user.permissions?.chat?.export ?? true)}
|
||||
<DropdownSub
|
||||
contentClass="select-none rounded-2xl p-1 z-50 bg-white dark:bg-gray-850 dark:text-white shadow-lg border border-gray-100 dark:border-gray-800"
|
||||
>
|
||||
@@ -325,7 +326,6 @@
|
||||
<div class="flex items-center">{$i18n.t('Download')}</div>
|
||||
</button>
|
||||
|
||||
{#if $user?.role === 'admin' || ($user.permissions?.chat?.export ?? true)}
|
||||
<button
|
||||
draggable="false"
|
||||
class="flex gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl w-full"
|
||||
@@ -335,7 +335,6 @@
|
||||
>
|
||||
<div class="flex items-center line-clamp-1">{$i18n.t('Export chat (.json)')}</div>
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
<button
|
||||
draggable="false"
|
||||
@@ -357,6 +356,7 @@
|
||||
<div class="flex items-center line-clamp-1">{$i18n.t('PDF document (.pdf)')}</div>
|
||||
</button>
|
||||
</DropdownSub>
|
||||
{/if}
|
||||
|
||||
<button
|
||||
draggable="false"
|
||||
|
||||
Reference in new issue
Block a user