fix(chat-sharing): Add UI and Environment variable for setting public

chat sharing in user permissions.
This commit is contained in:
Steven Schveighoffer 2026-04-27 13:39:50 -04:00
parent 4e2240aada
commit e87faf2b54
3 changed files with 22 additions and 0 deletions

View file

@ -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,

View file

@ -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):

View file

@ -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" />