From 8bc7d85eac6efb46111a8ae04467fc16fdad0e32 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 22 Jul 2025 17:17:26 +0400 Subject: [PATCH] refac --- backend/open_webui/retrieval/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/retrieval/utils.py b/backend/open_webui/retrieval/utils.py index 7edc3c35ac..539adda329 100644 --- a/backend/open_webui/retrieval/utils.py +++ b/backend/open_webui/retrieval/utils.py @@ -509,7 +509,9 @@ def get_sources_from_items( note = Notes.get_note_by_id(item.get("id")) if note and ( - user.role == "admin" or has_access(user.id, "read", note.access_control) + user.role == "admin" + or note.user_id == user.id + or has_access(user.id, "read", note.access_control) ): # User has access to the note query_result = {