feat(material): 采购链接接入读写映射与服务层
· models/base.py:新增 purchase_link 列(text)并加入 to_dict(purchaseLink)
· field_permissions.py:读过滤映射 purchaseLink → material_list:purchaseLink
· inbound/base.py:POST 与 PUT 两处 field_to_perm 同时补入(漏掉任一处,
新增/修改就会各缺一半)
· base_service.py:create_material 写入、update_material 按字段存在与否更新
★ 写侧刻意**显式纳入映射**而非依赖「不在映射中→默认允许」的兜底分支 ——
那个分支正是上一轮附件备注「谁都能写」的成因,新字段不再走它。
验证(6 个角色)
SUPER_ADMIN / SUPERVISOR / WAREHOUSE_MGR / INBOUND → 读✓ 写✓
OUTBOUND / SALES → 读✗ 写✗
读写逐角色一致;超管走 material_list:* 通配分支、过滤整段跳过(已单独复核)。
This commit is contained in:
@ -276,6 +276,9 @@ def create():
|
||||
# 会被 _expand_operation_perms 前缀桥接放大给 material_list:operation。
|
||||
'productImageRemark': 'material_list:remark_edit',
|
||||
'manualLinkRemark': 'material_list:remark_edit',
|
||||
# 采购链接:与读过滤 field_permissions.py 用**同一个码**,
|
||||
# 避免「写用一个码、读用另一个码」再次造成读写错位。
|
||||
'purchaseLink': 'material_list:purchaseLink',
|
||||
'referencePrice': 'material_list:referencePrice',
|
||||
'isEnabled': 'material_list:isEnabled'
|
||||
}
|
||||
@ -343,6 +346,9 @@ def update(id):
|
||||
# 会被 _expand_operation_perms 前缀桥接放大给 material_list:operation。
|
||||
'productImageRemark': 'material_list:remark_edit',
|
||||
'manualLinkRemark': 'material_list:remark_edit',
|
||||
# 采购链接:与读过滤 field_permissions.py 用**同一个码**,
|
||||
# 避免「写用一个码、读用另一个码」再次造成读写错位。
|
||||
'purchaseLink': 'material_list:purchaseLink',
|
||||
'referencePrice': 'material_list:referencePrice',
|
||||
'isEnabled': 'material_list:isEnabled'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user