mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 20:07:49 +01:00
fix: temp chat perm
This commit is contained in:
@@ -902,10 +902,17 @@
|
|||||||
|
|
||||||
const initNewChat = async () => {
|
const initNewChat = async () => {
|
||||||
console.log('initNewChat');
|
console.log('initNewChat');
|
||||||
if ($user?.role !== 'admin' && $user?.permissions?.chat?.temporary_enforced) {
|
if ($user?.role !== 'admin') {
|
||||||
|
if ($user?.permissions?.chat?.temporary_enforced) {
|
||||||
await temporaryChatEnabled.set(true);
|
await temporaryChatEnabled.set(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$user?.permissions?.chat?.temporary) {
|
||||||
|
await temporaryChatEnabled.set(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($settings?.temporaryChatByDefault ?? false) {
|
if ($settings?.temporaryChatByDefault ?? false) {
|
||||||
if ($temporaryChatEnabled === false) {
|
if ($temporaryChatEnabled === false) {
|
||||||
await temporaryChatEnabled.set(true);
|
await temporaryChatEnabled.set(true);
|
||||||
|
|||||||
@@ -713,6 +713,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{#if $user.role === 'admin' || $user?.permissions?.chat?.temporary}
|
||||||
<div>
|
<div>
|
||||||
<div class=" py-0.5 flex w-full justify-between">
|
<div class=" py-0.5 flex w-full justify-between">
|
||||||
<div id="temp-chat-default-label" class=" self-center text-xs">
|
<div id="temp-chat-default-label" class=" self-center text-xs">
|
||||||
@@ -731,6 +732,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div class=" py-0.5 flex w-full justify-between">
|
<div class=" py-0.5 flex w-full justify-between">
|
||||||
|
|||||||
Reference in New Issue
Block a user