open-webui/src/lib/components/admin/Users/Groups/Permissions.svelte

643 lines
19 KiB
Svelte
Raw Normal View History

2024-11-14 05:21:50 +00:00
<script lang="ts">
2025-01-16 07:01:43 +00:00
import { getContext, onMount } from 'svelte';
2024-11-14 05:21:50 +00:00
const i18n = getContext('i18n');
2025-09-28 19:33:40 +00:00
import Switch from '$lib/components/common/Switch.svelte';
2024-11-15 04:51:49 +00:00
import Tooltip from '$lib/components/common/Tooltip.svelte';
2025-01-16 07:01:43 +00:00
// Default values for permissions
const DEFAULT_PERMISSIONS = {
2024-11-15 04:51:49 +00:00
workspace: {
models: false,
knowledge: false,
prompts: false,
tools: false
},
2025-04-01 00:15:51 +00:00
sharing: {
public_models: false,
public_knowledge: false,
public_prompts: false,
public_tools: false,
public_notes: false
2025-04-01 00:15:51 +00:00
},
2024-11-15 04:51:49 +00:00
chat: {
2025-01-16 07:01:43 +00:00
controls: true,
2025-07-31 14:58:58 +00:00
valves: true,
system_prompt: true,
params: true,
2025-04-14 08:40:22 +00:00
file_upload: true,
2024-11-15 04:51:49 +00:00
delete: true,
delete_message: true,
continue_response: true,
regenerate_response: true,
rate_response: true,
2024-11-15 04:51:49 +00:00
edit: true,
2025-04-23 05:43:33 +00:00
share: true,
export: true,
2025-04-14 08:40:22 +00:00
stt: true,
tts: true,
call: true,
multiple_models: true,
2024-11-16 10:31:04 +00:00
temporary: true,
temporary_enforced: false
2025-01-16 07:01:43 +00:00
},
features: {
2025-04-03 01:36:03 +00:00
direct_tool_servers: false,
2025-01-16 07:01:43 +00:00
web_search: true,
2025-02-04 05:56:35 +00:00
image_generation: true,
2025-05-04 13:22:51 +00:00
code_interpreter: true,
notes: true
2024-11-15 04:51:49 +00:00
}
};
2025-01-16 07:01:43 +00:00
export let permissions = {};
export let defaultPermissions = {};
2025-01-16 07:01:43 +00:00
// Reactive statement to ensure all fields are present in `permissions`
$: {
permissions = fillMissingProperties(permissions, DEFAULT_PERMISSIONS);
2025-01-16 07:01:43 +00:00
}
function fillMissingProperties(obj: any, defaults: any) {
return {
...defaults,
...obj,
workspace: { ...defaults.workspace, ...obj.workspace },
2025-04-01 00:15:51 +00:00
sharing: { ...defaults.sharing, ...obj.sharing },
2025-01-16 07:01:43 +00:00
chat: { ...defaults.chat, ...obj.chat },
features: { ...defaults.features, ...obj.features }
};
}
onMount(() => {
permissions = fillMissingProperties(permissions, DEFAULT_PERMISSIONS);
2025-01-16 07:01:43 +00:00
});
2024-11-14 05:21:50 +00:00
</script>
<div class="space-y-2">
2025-09-29 05:58:21 +00:00
<!-- {$i18n.t('Default Model')}
{$i18n.t('Model Filtering')}
{$i18n.t('Model Permissions')}
{$i18n.t('No model IDs')} -->
2024-11-14 05:21:50 +00:00
<div>
<div class=" mb-2 text-sm font-medium">{$i18n.t('Workspace Permissions')}</div>
2025-09-28 19:33:40 +00:00
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Models Access')}
</div>
<Switch bind:state={permissions.workspace.models} />
</div>
{#if defaultPermissions?.workspace?.models && !permissions.workspace.models}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Knowledge Access')}
</div>
<Switch bind:state={permissions.workspace.knowledge} />
</div>
{#if defaultPermissions?.workspace?.knowledge && !permissions.workspace.knowledge}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Prompts Access')}
</div>
<Switch bind:state={permissions.workspace.prompts} />
</div>
{#if defaultPermissions?.workspace?.prompts && !permissions.workspace.prompts}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
<div class="flex flex-col w-full">
<Tooltip
2025-09-29 05:03:03 +00:00
className="flex w-full justify-between my-1"
2025-09-28 19:33:40 +00:00
content={$i18n.t(
2024-11-15 04:51:49 +00:00
'Warning: Enabling this will allow users to upload arbitrary code on the server.'
)}
2025-09-28 19:33:40 +00:00
placement="top-start"
>
<div class=" self-center text-xs font-medium">
{$i18n.t('Tools Access')}
</div>
<Switch bind:state={permissions.workspace.tools} />
</Tooltip>
{#if defaultPermissions?.workspace?.tools && !permissions.workspace.tools}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
2024-11-14 05:21:50 +00:00
</div>
</div>
<hr class=" border-gray-100 dark:border-gray-850" />
2025-04-01 00:15:51 +00:00
<div>
<div class=" mb-2 text-sm font-medium">{$i18n.t('Sharing Permissions')}</div>
2025-09-28 19:33:40 +00:00
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Models Public Sharing')}
</div>
<Switch bind:state={permissions.sharing.public_models} />
</div>
{#if defaultPermissions?.sharing?.public_models && !permissions.sharing.public_models}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Knowledge Public Sharing')}
</div>
<Switch bind:state={permissions.sharing.public_knowledge} />
</div>
{#if defaultPermissions?.sharing?.public_knowledge && !permissions.sharing.public_knowledge}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Prompts Public Sharing')}
</div>
<Switch bind:state={permissions.sharing.public_prompts} />
</div>
{#if defaultPermissions?.sharing?.public_prompts && !permissions.sharing.public_prompts}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Tools Public Sharing')}
</div>
<Switch bind:state={permissions.sharing.public_tools} />
</div>
{#if defaultPermissions?.sharing?.public_tools && !permissions.sharing.public_tools}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Notes Public Sharing')}
</div>
<Switch bind:state={permissions.sharing.public_notes} />
</div>
{#if defaultPermissions?.sharing?.public_notes && !permissions.sharing.public_notes}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
2025-04-01 00:15:51 +00:00
</div>
<hr class=" border-gray-100 dark:border-gray-850" />
2024-11-14 05:21:50 +00:00
<div>
<div class=" mb-2 text-sm font-medium">{$i18n.t('Chat Permissions')}</div>
2025-09-28 19:33:40 +00:00
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Allow File Upload')}
</div>
<Switch bind:state={permissions.chat.file_upload} />
</div>
{#if defaultPermissions?.chat?.file_upload && !permissions.chat.file_upload}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Allow Chat Controls')}
</div>
<Switch bind:state={permissions.chat.controls} />
</div>
{#if defaultPermissions?.chat?.controls && !permissions.chat.controls}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
{#if permissions.chat.controls}
2025-09-29 05:03:03 +00:00
<div class="flex flex-col w-full">
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Allow Chat Valves')}
</div>
<Switch bind:state={permissions.chat.valves} />
</div>
{#if defaultPermissions?.chat?.valves && !permissions.chat.valves}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
2025-09-29 05:03:03 +00:00
<div class="flex flex-col w-full">
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Allow Chat System Prompt')}
</div>
<Switch bind:state={permissions.chat.system_prompt} />
</div>
{#if defaultPermissions?.chat?.system_prompt && !permissions.chat.system_prompt}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
2025-09-29 05:03:03 +00:00
<div class="flex flex-col w-full">
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Allow Chat Params')}
</div>
<Switch bind:state={permissions.chat.params} />
</div>
{#if defaultPermissions?.chat?.params && !permissions.chat.params}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
{/if}
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Allow Chat Edit')}
</div>
<Switch bind:state={permissions.chat.edit} />
</div>
{#if defaultPermissions?.chat?.edit && !permissions.chat.edit}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Allow Chat Delete')}
</div>
<Switch bind:state={permissions.chat.delete} />
</div>
{#if defaultPermissions?.chat?.delete && !permissions.chat.delete}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Allow Delete Messages')}
</div>
<Switch bind:state={permissions.chat.delete_message} />
</div>
{#if defaultPermissions?.chat?.delete_message && !permissions.chat.delete_message}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Allow Continue Response')}
</div>
<Switch bind:state={permissions.chat.continue_response} />
</div>
{#if defaultPermissions?.chat?.continue_response && !permissions.chat.continue_response}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Allow Regenerate Response')}
</div>
<Switch bind:state={permissions.chat.regenerate_response} />
</div>
{#if defaultPermissions?.chat?.regenerate_response && !permissions.chat.regenerate_response}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Allow Rate Response')}
</div>
<Switch bind:state={permissions.chat.rate_response} />
</div>
{#if defaultPermissions?.chat?.rate_response && !permissions.chat.rate_response}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Allow Chat Share')}
</div>
<Switch bind:state={permissions.chat.share} />
</div>
{#if defaultPermissions?.chat?.share && !permissions.chat.share}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Allow Chat Export')}
</div>
<Switch bind:state={permissions.chat.export} />
</div>
{#if defaultPermissions?.chat?.export && !permissions.chat.export}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Allow Speech to Text')}
</div>
<Switch bind:state={permissions.chat.stt} />
</div>
{#if defaultPermissions?.chat?.stt && !permissions.chat.stt}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Allow Text to Speech')}
</div>
<Switch bind:state={permissions.chat.tts} />
</div>
{#if defaultPermissions?.chat?.tts && !permissions.chat.tts}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Allow Call')}
</div>
<Switch bind:state={permissions.chat.call} />
</div>
{#if defaultPermissions?.chat?.call && !permissions.chat.call}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
2025-09-28 19:33:40 +00:00
</div>
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Allow Multiple Models in Chat')}
</div>
<Switch bind:state={permissions.chat.multiple_models} />
</div>
{#if defaultPermissions?.chat?.multiple_models && !permissions.chat.multiple_models}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
2025-09-28 19:33:40 +00:00
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Allow Temporary Chat')}
</div>
<Switch bind:state={permissions.chat.temporary} />
</div>
{#if defaultPermissions?.chat?.temporary && !permissions.chat.temporary}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
2025-04-14 08:40:22 +00:00
</div>
2025-09-28 19:33:40 +00:00
{#if permissions.chat.temporary}
2025-09-29 05:03:03 +00:00
<div class="flex flex-col w-full">
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Enforce Temporary Chat')}
</div>
<Switch bind:state={permissions.chat.temporary_enforced} />
</div>
{#if defaultPermissions?.chat?.temporary_enforced && !permissions.chat.temporary_enforced}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
{/if}
2024-11-14 05:21:50 +00:00
</div>
2025-01-16 07:01:43 +00:00
<hr class=" border-gray-100 dark:border-gray-850" />
2025-01-16 07:01:43 +00:00
<div>
<div class=" mb-2 text-sm font-medium">{$i18n.t('Features Permissions')}</div>
2025-09-28 19:33:40 +00:00
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Direct Tool Servers')}
</div>
<Switch bind:state={permissions.features.direct_tool_servers} />
</div>
{#if defaultPermissions?.features?.direct_tool_servers && !permissions.features.direct_tool_servers}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Web Search')}
</div>
<Switch bind:state={permissions.features.web_search} />
</div>
{#if defaultPermissions?.features?.web_search && !permissions.features.web_search}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Image Generation')}
</div>
<Switch bind:state={permissions.features.image_generation} />
</div>
{#if defaultPermissions?.features?.image_generation && !permissions.features.image_generation}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Code Interpreter')}
</div>
<Switch bind:state={permissions.features.code_interpreter} />
</div>
{#if defaultPermissions?.features?.code_interpreter && !permissions.features.code_interpreter}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
</div>
<div class="flex flex-col w-full">
2025-09-29 05:03:03 +00:00
<div class="flex w-full justify-between my-1">
2025-09-28 19:33:40 +00:00
<div class=" self-center text-xs font-medium">
{$i18n.t('Notes')}
</div>
<Switch bind:state={permissions.features.notes} />
</div>
{#if defaultPermissions?.features?.notes && !permissions.features.notes}
2025-09-29 05:03:03 +00:00
<div>
<div class="text-xs text-gray-500">
{$i18n.t('This is a default user permission and will remain enabled.')}
2025-09-28 19:33:40 +00:00
</div>
</div>
{/if}
2025-05-04 13:22:51 +00:00
</div>
2025-01-16 07:01:43 +00:00
</div>
2025-09-28 19:33:40 +00:00
</div>