Merge pull request #17801 from Classic298/feature/notes-public-sharing-permission

feat: add permission toggle for public sharing of notes
This commit is contained in:
Tim Jaeryang Baek
2025-09-26 16:11:17 -05:00
committed by GitHub
4 changed files with 28 additions and 1 deletions
+12
View File
@@ -180,6 +180,18 @@ async def update_note_by_id(
status_code=status.HTTP_403_FORBIDDEN, detail=ERROR_MESSAGES.DEFAULT()
)
# Check if user can share publicly
if (
user.role != "admin"
and form_data.access_control == None
and not has_permission(
user.id,
"sharing.public_notes",
request.app.state.config.USER_PERMISSIONS,
)
):
form_data.access_control = {}
try:
note = Notes.update_note_by_id(id, form_data)
await sio.emit(
+1
View File
@@ -157,6 +157,7 @@ class SharingPermissions(BaseModel):
public_knowledge: bool = True
public_prompts: bool = True
public_tools: bool = True
public_notes: bool = True
class ChatPermissions(BaseModel):