feat: virtual company module, team projects, PWA dishes app, and startup scripts overhaul
- Add company module (3-tier org, CEO planning, parallel departments) - Add company orchestrator, knowledge extractor, presets, scheduler - Add company API endpoints, models, and frontend views - Add 今天吃啥 PWA app (69 dishes, real images, offline support) - Add team_projects output directory structure - Add unified manage.ps1 for service lifecycle - Add Windows startup guide v1.0 - Add TTS troubleshooting doc - Update frontend (AgentChat UX overhaul, new views) - Update backend (voice engine fix, multi-tenant, RBAC) - Remove deprecated startup scripts and old docs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -127,7 +127,7 @@ async def get_agents(
|
||||
支持分页、搜索、状态筛选、工作区筛选
|
||||
"""
|
||||
# 管理员可以看到所有Agent,普通用户只能看到自己拥有的或有read权限的
|
||||
if current_user.role == "admin":
|
||||
if current_user.has_permission("agent:view_all"):
|
||||
query = db.query(Agent)
|
||||
else:
|
||||
# 获取用户拥有或有read权限的Agent
|
||||
@@ -397,8 +397,8 @@ async def delete_agent(
|
||||
if not agent:
|
||||
raise NotFoundError(f"Agent不存在: {agent_id}")
|
||||
|
||||
# 只有Agent所有者可以删除
|
||||
if agent.user_id != current_user.id and current_user.role != "admin":
|
||||
# 只有Agent所有者或管理员可以删除
|
||||
if agent.user_id != current_user.id and not current_user.has_permission("agent:delete"):
|
||||
raise HTTPException(status_code=403, detail="无权删除此Agent")
|
||||
|
||||
agent_name = agent.name
|
||||
|
||||
Reference in New Issue
Block a user