fix: correct default sorting and export desensitization logic
Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) <aider@aider.chat>
This commit is contained in:
@ -25,7 +25,23 @@ def get_current_user_permissions():
|
||||
return []
|
||||
# 超级管理员返回所有字段权限 (忽略大小写)
|
||||
if user_role.upper() == 'SUPER_ADMIN':
|
||||
return ['material_list:*']
|
||||
# 返回通配符权限(供列表脱敏使用)以及所有具体权限(供导出脱敏使用)
|
||||
return [
|
||||
'material_list:*',
|
||||
'material_list:id',
|
||||
'material_list:companyName',
|
||||
'material_list:name',
|
||||
'material_list:commonName',
|
||||
'material_list:category',
|
||||
'material_list:type',
|
||||
'material_list:spec',
|
||||
'material_list:unit',
|
||||
'material_list:inventoryCount',
|
||||
'material_list:availableCount',
|
||||
'material_list:files',
|
||||
'material_list:isEnabled',
|
||||
'material_list:operation'
|
||||
]
|
||||
perm_dict = AuthService.get_user_permissions(user_role)
|
||||
# 合并菜单和元素权限
|
||||
perms = perm_dict.get('menus', []) + perm_dict.get('elements', [])
|
||||
|
||||
Reference in New Issue
Block a user