mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-14 09:21:22 +00:00
fix(chat-sharing): Add UI and Environment variable for setting public
chat sharing in user permissions.
This commit is contained in:
parent
4e2240aada
commit
e87faf2b54
3 changed files with 22 additions and 0 deletions
|
|
@ -1495,6 +1495,11 @@ USER_PERMISSIONS_CHAT_TEMPORARY_ENFORCED = (
|
|||
os.environ.get('USER_PERMISSIONS_CHAT_TEMPORARY_ENFORCED', 'False').lower() == 'true'
|
||||
)
|
||||
|
||||
USER_PERMISSIONS_CHAT_ALLOW_PUBLIC_SHARING = (
|
||||
os.environ.get('USER_PERMISSIONS_CHAT_ALLOW_PUBLIC_SHARING', 'False').lower() == 'true'
|
||||
)
|
||||
|
||||
|
||||
|
||||
USER_PERMISSIONS_FEATURES_DIRECT_TOOL_SERVERS = (
|
||||
os.environ.get('USER_PERMISSIONS_FEATURES_DIRECT_TOOL_SERVERS', 'False').lower() == 'true'
|
||||
|
|
@ -1557,6 +1562,7 @@ DEFAULT_USER_PERMISSIONS = {
|
|||
'public_skills': USER_PERMISSIONS_WORKSPACE_SKILLS_ALLOW_PUBLIC_SHARING,
|
||||
'notes': USER_PERMISSIONS_NOTES_ALLOW_SHARING,
|
||||
'public_notes': USER_PERMISSIONS_NOTES_ALLOW_PUBLIC_SHARING,
|
||||
'public_chats': USER_PERMISSIONS_CHAT_ALLOW_PUBLIC_SHARING,
|
||||
},
|
||||
'access_grants': {
|
||||
'allow_users': USER_PERMISSIONS_ACCESS_GRANTS_ALLOW_USERS,
|
||||
|
|
|
|||
|
|
@ -193,6 +193,7 @@ class SharingPermissions(BaseModel):
|
|||
public_skills: bool = False
|
||||
notes: bool = False
|
||||
public_notes: bool = True
|
||||
public_chats: bool = False
|
||||
|
||||
|
||||
class AccessGrantsPermissions(BaseModel):
|
||||
|
|
|
|||
|
|
@ -392,6 +392,21 @@
|
|||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
<div class="flex flex-col w-full">
|
||||
<div class="flex w-full justify-between my-1">
|
||||
<div class=" self-center text-xs font-medium">
|
||||
{$i18n.t('Chats Public Sharing')}
|
||||
</div>
|
||||
<Switch bind:state={permissions.sharing.public_chats} />
|
||||
</div>
|
||||
{#if defaultPermissions?.sharing?.public_chats && !permissions.sharing.public_chats}
|
||||
<div>
|
||||
<div class="text-xs text-gray-500">
|
||||
{$i18n.t('This is a default user permission and will remain enabled.')}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class=" border-gray-100/30 dark:border-gray-850/30" />
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue