From 9a347b037641679cd3e5054d5fc31210d460779a Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Mon, 25 May 2026 18:13:11 +0200 Subject: [PATCH] Update knowledge.py (#25053) --- backend/open_webui/routers/knowledge.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/backend/open_webui/routers/knowledge.py b/backend/open_webui/routers/knowledge.py index 4bf48d370d..25a70a6483 100644 --- a/backend/open_webui/routers/knowledge.py +++ b/backend/open_webui/routers/knowledge.py @@ -847,10 +847,7 @@ async def remove_file_from_knowledge_by_id( log.debug(e) pass - # Only the file owner or an admin may permanently delete the underlying - # file. Collaborators with KB write access can unlink a file from the - # knowledge base but must not be able to destroy files they do not own, - # as the same file may be referenced by other KBs and chats. + # Anyone with write permission or higher can delete files if delete_file and (file.user_id == user.id or user.role == 'admin'): try: # Remove the file's collection from vector database