后端 routes/bot_manager.py - 在 check_bot_access 函数中添加了对 is_published 的检查:
This commit is contained in:
parent
b75afac520
commit
ed440564f3
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user