diff --git a/api/apps/kb_app.py b/api/apps/kb_app.py index 5072d14a97..6bbd02ee5b 100644 --- a/api/apps/kb_app.py +++ b/api/apps/kb_app.py @@ -100,6 +100,15 @@ def update(): def detail(): kb_id = request.args["kb_id"] try: + tenants = TenantService.get_joined_tenants_by_user_id(current_user.id) + for m in tenants: + if KnowledgebaseService.query( + tenant_id=m["tenant_id"], id=kb_id): + break + else: + return get_json_result( + data=False, retmsg=f'Only owner of knowledgebase authorized for this operation.', + retcode=RetCode.OPERATING_ERROR) kb = KnowledgebaseService.get_detail(kb_id) if not kb: return get_data_error_result(