From 45c1c33150d20f998dfc34aead7dca48a5cb2805 Mon Sep 17 00:00:00 2001 From: LiuHua <10215101452@stu.ecnu.edu.cn> Date: Tue, 3 Sep 2024 16:28:46 +0800 Subject: [PATCH] Add Authorization checks (#2218) ### What problem does this PR solve? Add Authorization checks #2203 ### Type of change - [x] New Feature (non-breaking change which adds functionality) Co-authored-by: Feiue <10215101452@stu.ecun.edu.cn> --- api/apps/kb_app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/apps/kb_app.py b/api/apps/kb_app.py index 6bbd02ee5b..7d7f86e2dc 100644 --- a/api/apps/kb_app.py +++ b/api/apps/kb_app.py @@ -100,10 +100,10 @@ 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: + tenants = UserTenantService.query(user_id=current_user.id) + for tenant in tenants: if KnowledgebaseService.query( - tenant_id=m["tenant_id"], id=kb_id): + tenant_id=tenant.tenant_id, id=kb_id): break else: return get_json_result(