From ed440564f328c2aa09ee44345ba5efe467531405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E6=BD=AE?= Date: Sun, 22 Feb 2026 21:17:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E7=AB=AF=20routes/bot=5Fmanager.py=20?= =?UTF-8?q?-=20=E5=9C=A8=20check=5Fbot=5Faccess=20=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E4=B8=AD=E6=B7=BB=E5=8A=A0=E4=BA=86=E5=AF=B9=20is=5Fpublished?= =?UTF-8?q?=20=E7=9A=84=E6=A3=80=E6=9F=A5=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routes/bot_manager.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/routes/bot_manager.py b/routes/bot_manager.py index f89318a..40b4b94 100644 --- a/routes/bot_manager.py +++ b/routes/bot_manager.py @@ -194,6 +194,15 @@ async def check_bot_access(bot_id: str, user_id: str, required_permission: str) if await cursor.fetchone(): return True + # 检查是否是公开到广场的智能体(所有人都可以 read) + if required_permission == 'read': + await cursor.execute(""" + SELECT is_published FROM agent_bots WHERE id = %s + """, (bot_id,)) + pub_row = await cursor.fetchone() + if pub_row and pub_row[0]: + return True + # 检查是否在分享列表中(同��检查过期时间) await cursor.execute(""" SELECT role, expires_at FROM bot_shares