fix: make SUPER_ADMIN role checks case-insensitive across app

Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) <aider@aider.chat>
This commit is contained in:
dxc
2026-02-27 17:04:22 +08:00
parent ad8bb5a75d
commit a0993767fe
11 changed files with 32 additions and 19 deletions

View File

@ -21,8 +21,8 @@ def get_current_user_permissions():
user_role = claims.get('role')
if not user_role:
return []
# 超级管理员返回所有字段权限
if user_role == 'super_admin':
# 超级管理员返回所有字段权限 (忽略大小写)
if user_role.upper() == 'SUPER_ADMIN':
return ['inbound_service:*']
perm_dict = AuthService.get_user_permissions(user_role)
# 合并菜单和元素权限