We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ba83613 commit 914ccf0Copy full SHA for 914ccf0
1 file changed
backend/open_webui/routers/knowledge.py
@@ -826,7 +826,11 @@ async def remove_file_from_knowledge_by_id(
826
log.debug(e)
827
pass
828
829
- if delete_file:
+ # Only the file owner or an admin may permanently delete the underlying
830
+ # file. Collaborators with KB write access can unlink a file from the
831
+ # knowledge base but must not be able to destroy files they do not own,
832
+ # as the same file may be referenced by other KBs and chats.
833
+ if delete_file and (file.user_id == user.id or user.role == 'admin'):
834
try:
835
# Remove the file's collection from vector database
836
file_collection = f'file-{form_data.file_id}'
0 commit comments