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>
|
</button>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
{#if $user?.role === 'admin' || ($user.permissions?.chat?.export ?? true)}
|
||||||
<DropdownSub>
|
<DropdownSub>
|
||||||
<button
|
<button
|
||||||
slot="trigger"
|
slot="trigger"
|
||||||
@@ -389,7 +390,7 @@
|
|||||||
|
|
||||||
<div class="flex items-center">{$i18n.t('Download')}</div>
|
<div class="flex items-center">{$i18n.t('Download')}</div>
|
||||||
</button>
|
</button>
|
||||||
{#if $user?.role === 'admin' || ($user.permissions?.chat?.export ?? true)}
|
|
||||||
<button
|
<button
|
||||||
draggable="false"
|
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"
|
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>
|
<div class="flex items-center line-clamp-1">{$i18n.t('Export chat (.json)')}</div>
|
||||||
</button>
|
</button>
|
||||||
{/if}
|
|
||||||
<button
|
<button
|
||||||
draggable="false"
|
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"
|
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>
|
<div class="flex items-center line-clamp-1">{$i18n.t('PDF document (.pdf)')}</div>
|
||||||
</button>
|
</button>
|
||||||
</DropdownSub>
|
</DropdownSub>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<button
|
<button
|
||||||
draggable="false"
|
draggable="false"
|
||||||
|
|||||||
@@ -313,6 +313,7 @@
|
|||||||
</button>
|
</button>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
{#if $user?.role === 'admin' || ($user.permissions?.chat?.export ?? true)}
|
||||||
<DropdownSub
|
<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"
|
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>
|
<div class="flex items-center">{$i18n.t('Download')}</div>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{#if $user?.role === 'admin' || ($user.permissions?.chat?.export ?? true)}
|
|
||||||
<button
|
<button
|
||||||
draggable="false"
|
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"
|
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>
|
<div class="flex items-center line-clamp-1">{$i18n.t('Export chat (.json)')}</div>
|
||||||
</button>
|
</button>
|
||||||
{/if}
|
|
||||||
|
|
||||||
<button
|
<button
|
||||||
draggable="false"
|
draggable="false"
|
||||||
@@ -357,6 +356,7 @@
|
|||||||
<div class="flex items-center line-clamp-1">{$i18n.t('PDF document (.pdf)')}</div>
|
<div class="flex items-center line-clamp-1">{$i18n.t('PDF document (.pdf)')}</div>
|
||||||
</button>
|
</button>
|
||||||
</DropdownSub>
|
</DropdownSub>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<button
|
<button
|
||||||
draggable="false"
|
draggable="false"
|
||||||
|
|||||||
Reference in new issue
Block a user