fix: 彻底移除 op_records 字段级权限过滤,所有字段对普通角色可见
This commit is contained in:
@ -35,16 +35,17 @@ def filter_item_by_permissions(item_dict, user_permissions, prefix='op_records')
|
||||
"""
|
||||
# 字段名到权限码的映射(与前端 permissionMap 保持一致)
|
||||
field_to_perm = {
|
||||
'borrow_no': f'{prefix}:borrow_no',
|
||||
'borrower_name': f'{prefix}:borrower_name',
|
||||
# 'sku': f'{prefix}:sku', # SKU 字段不再参与权限过滤,直接返回
|
||||
'borrow_time': f'{prefix}:borrow_time',
|
||||
'return_time': f'{prefix}:return_time',
|
||||
'status': f'{prefix}:status',
|
||||
'expected_return_time': f'{prefix}:expected_return_time',
|
||||
'return_location': f'{prefix}:return_location',
|
||||
'borrow_signature': f'{prefix}:borrow_signature',
|
||||
'return_signature': f'{prefix}:return_signature',
|
||||
# 'borrow_no': f'{prefix}:borrow_no',
|
||||
# 'borrower_name': f'{prefix}:borrower_name',
|
||||
# 'sku': f'{prefix}:sku',
|
||||
# 'borrow_time': f'{prefix}:borrow_time',
|
||||
# 'return_time': f'{prefix}:return_time',
|
||||
# 'return_operator': f'{prefix}:return_operator',
|
||||
# 'status': f'{prefix}:status',
|
||||
# 'expected_return_time': f'{prefix}:expected_return_time',
|
||||
# 'return_location': f'{prefix}:return_location',
|
||||
# 'borrow_signature': f'{prefix}:borrow_signature',
|
||||
# 'return_signature': f'{prefix}:return_signature',
|
||||
}
|
||||
# 如果用户是超级管理员且有 '*',则不过滤
|
||||
if '*' in user_permissions:
|
||||
|
||||
Reference in New Issue
Block a user