Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

fix(api): restore accessible check on document preview (#15505)

kpdevd26d7994679b
diff --git a/api/apps/restful_apis/document_api.py b/api/apps/restful_apis/document_api.py
index eeb0e8bf94..dc30dba0db 100644
--- a/api/apps/restful_apis/document_api.py
+++ b/api/apps/restful_apis/document_api.py
@@ -1919,6 +1919,8 @@ async def get(doc_id):
enumeration.
"""
try:
+ if not DocumentService.accessible(doc_id, current_user.id):
+ return get_data_error_result(message="Document not found!")
e, doc = DocumentService.get_by_id(doc_id)
if not e: