fix: transactions filter_item_by_permissions 只保留签名过滤,基础字段不再剥离
This commit is contained in:
@ -47,28 +47,10 @@ def filter_item_by_permissions(item_dict, user_permissions, prefix='op_records')
|
||||
|
||||
★ Fail-Closed: 字段映射默认为完整列表,不再为空字典。
|
||||
"""
|
||||
# 仅过滤敏感字段(签名),基础字段在 sys_element 补齐前不过滤
|
||||
field_to_perm = {
|
||||
'id': f'{prefix}:id',
|
||||
'borrow_no': f'{prefix}:borrow_no',
|
||||
'borrower_name': f'{prefix}:borrower_name',
|
||||
'sku': f'{prefix}:sku',
|
||||
'source_table': f'{prefix}:source_table',
|
||||
'stock_id': f'{prefix}:stock_id',
|
||||
'barcode': f'{prefix}:barcode',
|
||||
'quantity': f'{prefix}:quantity',
|
||||
'returned_quantity': f'{prefix}:returned_quantity',
|
||||
'borrow_time': f'{prefix}:borrow_time',
|
||||
'return_time': f'{prefix}:return_time',
|
||||
'return_operator': f'{prefix}:return_operator',
|
||||
'return_location': f'{prefix}:return_location',
|
||||
'status': f'{prefix}:status',
|
||||
'expected_return_time': f'{prefix}:expected_return_time',
|
||||
'borrow_signature': f'{prefix}:borrow_signature',
|
||||
'return_signature': f'{prefix}:return_signature',
|
||||
'remark': f'{prefix}:remark',
|
||||
'material_name': f'{prefix}:material_name',
|
||||
'is_returned': f'{prefix}:is_returned',
|
||||
'current_location': f'{prefix}:current_location',
|
||||
}
|
||||
if '*' in user_permissions or f'{prefix}:*' in user_permissions:
|
||||
return item_dict
|
||||
|
||||
Reference in New Issue
Block a user