fix(douyu): 台账投影限制仅约束非管理员
- 人工 source_type=manual 订单完全不受投影限制 - 平台来源订单普通客服/运营只读,超级管理员可修正并审计 - 前端管理员解锁投影字段,普通账号仍只读 - 补充管理员/客服两条权限测试
This commit is contained in:
@@ -959,8 +959,12 @@ def update_order(
|
||||
if new != old:
|
||||
changes[field] = {"old": old, "new": new}
|
||||
|
||||
if order.source_type == SOURCE_TYPE_PLATFORM_FULFILLMENT:
|
||||
if (
|
||||
order.source_type == SOURCE_TYPE_PLATFORM_FULFILLMENT
|
||||
and current.role != "super_admin"
|
||||
):
|
||||
# 平台来源台账单是履约任务的投影:订单号/商品/积分/账号由平台维护。
|
||||
# 超级管理员保留全部修正权限;普通运营/客服只能走接管转人工。
|
||||
# 账号变更只有显式“接管转人工”才允许,避免协作页静默改出两个账号。
|
||||
projected = PLATFORM_PROJECTED_FIELDS.intersection(changes)
|
||||
if "account_username" in projected and takeover_platform_lease:
|
||||
@@ -1099,6 +1103,7 @@ def set_account(
|
||||
_assert_version(order, expected_version)
|
||||
if (
|
||||
order.source_type == SOURCE_TYPE_PLATFORM_FULFILLMENT
|
||||
and current.role != "super_admin"
|
||||
and not takeover_platform_lease
|
||||
):
|
||||
raise CollabError(
|
||||
|
||||
Reference in New Issue
Block a user