LiuHua
Feiue
commited on
Commit
·
614be86
1
Parent(s):
2ed172b
Add Authorization checks (#2218)
Browse files### 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 <[email protected]>
- api/apps/kb_app.py +3 -3
api/apps/kb_app.py
CHANGED
@@ -100,10 +100,10 @@ def update():
|
|
100 |
def detail():
|
101 |
kb_id = request.args["kb_id"]
|
102 |
try:
|
103 |
-
tenants =
|
104 |
-
for
|
105 |
if KnowledgebaseService.query(
|
106 |
-
tenant_id=
|
107 |
break
|
108 |
else:
|
109 |
return get_json_result(
|
|
|
100 |
def detail():
|
101 |
kb_id = request.args["kb_id"]
|
102 |
try:
|
103 |
+
tenants = UserTenantService.query(user_id=current_user.id)
|
104 |
+
for tenant in tenants:
|
105 |
if KnowledgebaseService.query(
|
106 |
+
tenant_id=tenant.tenant_id, id=kb_id):
|
107 |
break
|
108 |
else:
|
109 |
return get_json_result(
|