diff --git a/backend/open_webui/config.py b/backend/open_webui/config.py index fd2f34070..bfd01eed7 100644 --- a/backend/open_webui/config.py +++ b/backend/open_webui/config.py @@ -1077,6 +1077,10 @@ USER_PERMISSIONS_CHAT_CONTROLS = ( os.environ.get("USER_PERMISSIONS_CHAT_CONTROLS", "True").lower() == "true" ) +USER_PERMISSIONS_CHAT_SYSTEM_PROMPT = ( + os.environ.get("USER_PERMISSIONS_CHAT_SYSTEM_PROMPT", "True").lower() == "true" +) + USER_PERMISSIONS_CHAT_FILE_UPLOAD = ( os.environ.get("USER_PERMISSIONS_CHAT_FILE_UPLOAD", "True").lower() == "true" ) @@ -1162,6 +1166,7 @@ DEFAULT_USER_PERMISSIONS = { }, "chat": { "controls": USER_PERMISSIONS_CHAT_CONTROLS, + "system_prompt": USER_PERMISSIONS_CHAT_SYSTEM_PROMPT, "file_upload": USER_PERMISSIONS_CHAT_FILE_UPLOAD, "delete": USER_PERMISSIONS_CHAT_DELETE, "edit": USER_PERMISSIONS_CHAT_EDIT, diff --git a/backend/open_webui/routers/users.py b/backend/open_webui/routers/users.py index 3edd9b7dc..16cc2c375 100644 --- a/backend/open_webui/routers/users.py +++ b/backend/open_webui/routers/users.py @@ -133,6 +133,7 @@ class SharingPermissions(BaseModel): class ChatPermissions(BaseModel): controls: bool = True + system_prompt: bool = True file_upload: bool = True delete: bool = True edit: bool = True diff --git a/src/lib/components/admin/Users/Groups.svelte b/src/lib/components/admin/Users/Groups.svelte index 70e5832ea..338fbbd4c 100644 --- a/src/lib/components/admin/Users/Groups.svelte +++ b/src/lib/components/admin/Users/Groups.svelte @@ -65,6 +65,7 @@ }, chat: { controls: true, + system_prompt: true, file_upload: true, delete: true, edit: true, diff --git a/src/lib/components/admin/Users/Groups/Permissions.svelte b/src/lib/components/admin/Users/Groups/Permissions.svelte index 6af935813..04e81a807 100644 --- a/src/lib/components/admin/Users/Groups/Permissions.svelte +++ b/src/lib/components/admin/Users/Groups/Permissions.svelte @@ -263,6 +263,14 @@ +
+
+ {$i18n.t('Allow Chat System Prompt')} +
+ + +
+
{$i18n.t('Allow Chat Delete')} diff --git a/src/lib/components/chat/Controls/Controls.svelte b/src/lib/components/chat/Controls/Controls.svelte index d25d89a45..915d36f08 100644 --- a/src/lib/components/chat/Controls/Controls.svelte +++ b/src/lib/components/chat/Controls/Controls.svelte @@ -67,7 +67,7 @@
- {#if $user?.role === 'admin' || $user?.permissions.chat?.controls} + {#if $user?.role === 'admin' || ($user?.permissions.chat?.system_prompt ?? true)}
@@ -80,7 +80,9 @@ />
+ {/if} + {#if $user?.role === 'admin' || ($user?.permissions.chat?.controls ?? true)}
diff --git a/src/lib/components/chat/Settings/General.svelte b/src/lib/components/chat/Settings/General.svelte index 826d30050..4553c01e3 100644 --- a/src/lib/components/chat/Settings/General.svelte +++ b/src/lib/components/chat/Settings/General.svelte @@ -267,7 +267,7 @@ - {#if $user?.role === 'admin' || $user?.permissions.chat?.controls} + {#if $user?.role === 'admin' || ($user?.permissions.chat?.system_prompt ?? true)}
@@ -279,7 +279,9 @@ placeholder={$i18n.t('Enter system prompt here')} />
+ {/if} + {#if $user?.role === 'admin' || ($user?.permissions.chat?.controls ?? true)}
{$i18n.t('Advanced Parameters')}