后端 routes/bot_manager.py - 在 check_bot_access 函数中添加了对 is_published 的检查:

This commit is contained in:
朱潮 2026-02-22 21:17:34 +08:00
parent b75afac520
commit ed440564f3

View File

@ -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
# 检查是否在分享列表中<EFBC88><E5908C>检查过期时间
await cursor.execute("""
SELECT role, expires_at FROM bot_shares