Update knowledge.py (#25053)
This commit is contained in:
1 parent
42783881e9
commit
9a347b0376
1 file changed
+1
-4
@@ -847,10 +847,7 @@ async def remove_file_from_knowledge_by_id(
|
|||||||
log.debug(e)
|
log.debug(e)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Only the file owner or an admin may permanently delete the underlying
|
# Anyone with write permission or higher can delete files
|
||||||
# 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.
|
|
||||||
if delete_file and (file.user_id == user.id or user.role == 'admin'):
|
if delete_file and (file.user_id == user.id or user.role == 'admin'):
|
||||||
try:
|
try:
|
||||||
# Remove the file's collection from vector database
|
# Remove the file's collection from vector database
|
||||||
|
|||||||
Reference in new issue
Block a user