Merge branch 'role' into dev

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	backend/app/services/shipping_notice/rpa_worker_heartbeat_alert.py
#	backend/app/services/voucher_check/schedule_seed.py
#	docs/features/shipping-notice/technical.md
#	docs/tec.md
#	frontend/src/features/user/views/UserProfilePage.vue
This commit is contained in:
sophie committed 2026-09-22 18:25:45 +08:00
commit bb7e0977b8
94 files changed
+4493 -388

No files matched your search

@@ -91,7 +91,7 @@ def supports(*, user, agent, query: str) -> bool:
普通知识问答、普通员工提问或其他 Agent 一律不命中。
Args:
user: 当前聊天用户代理对象;需至少包含 role。
user: 当前聊天用户;须能 has_feature_permission('training_hr_manage')。
agent: 当前 Agent 代理对象;需能识别是否为员工培训 Agent。
query: 用户原始问题。
@@ -100,7 +100,7 @@ def supports(*, user, agent, query: str) -> bool:
"""
if not is_training_chat_agent(agent):
return False
if str(getattr(user, 'role', '') or '').strip() not in {'admin', 'hr'}:
if not bool(getattr(user, 'has_feature_permission', None) and user.has_feature_permission('training_hr_manage')):
return False
return (
_matches_any(query, _TRAINING_TOTAL_PATTERNS)