diff --git a/src/lib/components/admin/Users/Groups/Permissions.svelte b/src/lib/components/admin/Users/Groups/Permissions.svelte index 3663960d86..dfba887fd4 100644 --- a/src/lib/components/admin/Users/Groups/Permissions.svelte +++ b/src/lib/components/admin/Users/Groups/Permissions.svelte @@ -2,8 +2,8 @@ import { getContext, onMount } from 'svelte'; const i18n = getContext('i18n'); + import Switch from '$lib/components/common/Switch.svelte'; import Tooltip from '$lib/components/common/Tooltip.svelte'; - import PermissionSwitch from './PermissionSwitch.svelte'; // Default values for permissions const DEFAULT_PERMISSIONS = { @@ -77,30 +77,75 @@
{$i18n.t('Workspace Permissions')}
-
- - - - +
+
+ {$i18n.t('Models Access')} +
+ +
+ {#if defaultPermissions?.workspace?.models && !permissions.workspace.models} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+
+
+ {$i18n.t('Knowledge Access')} +
+ +
+ {#if defaultPermissions?.workspace?.knowledge && !permissions.workspace.knowledge} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+
+
+ {$i18n.t('Prompts Access')} +
+ +
+ {#if defaultPermissions?.workspace?.prompts && !permissions.workspace.prompts} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+ + placement="top-start" + > +
+ {$i18n.t('Tools Access')} +
+ +
+ {#if defaultPermissions?.workspace?.tools && !permissions.workspace.tools} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if}
@@ -108,32 +153,85 @@
{$i18n.t('Sharing Permissions')}
-
- - - - - + +
+
+
+ {$i18n.t('Models Public Sharing')} +
+ +
+ {#if defaultPermissions?.sharing?.public_models && !permissions.sharing.public_models} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+
+
+ {$i18n.t('Knowledge Public Sharing')} +
+ +
+ {#if defaultPermissions?.sharing?.public_knowledge && !permissions.sharing.public_knowledge} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+
+
+ {$i18n.t('Prompts Public Sharing')} +
+ +
+ {#if defaultPermissions?.sharing?.public_prompts && !permissions.sharing.public_prompts} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+
+
+ {$i18n.t('Tools Public Sharing')} +
+ +
+ {#if defaultPermissions?.sharing?.public_tools && !permissions.sharing.public_tools} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+
+
+ {$i18n.t('Notes Public Sharing')} +
+ +
+ {#if defaultPermissions?.sharing?.public_notes && !permissions.sharing.public_notes} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if}
@@ -141,146 +239,399 @@
{$i18n.t('Chat Permissions')}
-
- - - {#if permissions.chat.controls} -
- - - +
+
+
+ {$i18n.t('Allow File Upload')}
- {/if} - - - - - - - - - - - - - - - - {#if permissions.chat.temporary} -
- + +
+ {#if defaultPermissions?.chat?.file_upload && !permissions.chat.file_upload} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
{/if}
+ +
+
+
+ {$i18n.t('Allow Chat Controls')} +
+ +
+ {#if defaultPermissions?.chat?.controls && !permissions.chat.controls} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ + {#if permissions.chat.controls} +
+
+
+ {$i18n.t('Allow Chat Valves')} +
+ +
+ {#if defaultPermissions?.chat?.valves && !permissions.chat.valves} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+
+
+ {$i18n.t('Allow Chat System Prompt')} +
+ +
+ {#if defaultPermissions?.chat?.system_prompt && !permissions.chat.system_prompt} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+
+
+ {$i18n.t('Allow Chat Params')} +
+ +
+ {#if defaultPermissions?.chat?.params && !permissions.chat.params} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ {/if} + +
+
+
+ {$i18n.t('Allow Chat Edit')} +
+ +
+ {#if defaultPermissions?.chat?.edit && !permissions.chat.edit} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+
+
+ {$i18n.t('Allow Chat Delete')} +
+ +
+ {#if defaultPermissions?.chat?.delete && !permissions.chat.delete} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+
+
+ {$i18n.t('Allow Delete Messages')} +
+ +
+ {#if defaultPermissions?.chat?.delete_message && !permissions.chat.delete_message} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+
+
+ {$i18n.t('Allow Continue Response')} +
+ +
+ {#if defaultPermissions?.chat?.continue_response && !permissions.chat.continue_response} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+
+
+ {$i18n.t('Allow Regenerate Response')} +
+ +
+ {#if defaultPermissions?.chat?.regenerate_response && !permissions.chat.regenerate_response} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+
+
+ {$i18n.t('Allow Rate Response')} +
+ +
+ {#if defaultPermissions?.chat?.rate_response && !permissions.chat.rate_response} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+
+
+ {$i18n.t('Allow Chat Share')} +
+ +
+ {#if defaultPermissions?.chat?.share && !permissions.chat.share} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+
+
+ {$i18n.t('Allow Chat Export')} +
+ +
+ {#if defaultPermissions?.chat?.export && !permissions.chat.export} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+
+
+ {$i18n.t('Allow Speech to Text')} +
+ +
+ {#if defaultPermissions?.chat?.stt && !permissions.chat.stt} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+
+
+ {$i18n.t('Allow Text to Speech')} +
+ +
+ {#if defaultPermissions?.chat?.tts && !permissions.chat.tts} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+
+
+ {$i18n.t('Allow Call')} +
+ +
+ {#if defaultPermissions?.chat?.call && !permissions.chat.call} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+
+
+ {$i18n.t('Allow Multiple Models in Chat')} +
+ +
+ {#if defaultPermissions?.chat?.multiple_models && !permissions.chat.multiple_models} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+
+
+ {$i18n.t('Allow Temporary Chat')} +
+ +
+ {#if defaultPermissions?.chat?.temporary && !permissions.chat.temporary} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ + {#if permissions.chat.temporary} +
+
+
+ {$i18n.t('Enforce Temporary Chat')} +
+ +
+ {#if defaultPermissions?.chat?.temporary_enforced && !permissions.chat.temporary_enforced} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ {/if}

{$i18n.t('Features Permissions')}
-
- - - - - + +
+
+
+ {$i18n.t('Direct Tool Servers')} +
+ +
+ {#if defaultPermissions?.features?.direct_tool_servers && !permissions.features.direct_tool_servers} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+
+
+ {$i18n.t('Web Search')} +
+ +
+ {#if defaultPermissions?.features?.web_search && !permissions.features.web_search} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+
+
+ {$i18n.t('Image Generation')} +
+ +
+ {#if defaultPermissions?.features?.image_generation && !permissions.features.image_generation} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+
+
+ {$i18n.t('Code Interpreter')} +
+ +
+ {#if defaultPermissions?.features?.code_interpreter && !permissions.features.code_interpreter} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if} +
+ +
+
+
+ {$i18n.t('Notes')} +
+ +
+ {#if defaultPermissions?.features?.notes && !permissions.features.notes} +
+
+ ⚠️ {$i18n.t('This permission is enabled for the default "user" role and will remain active.')} +
+
+ {/if}
-
\ No newline at end of file +