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

@ -22,8 +22,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':
# 返回所有以 inbound_semi: 开头的权限码(这里我们返回一个特殊标记,表示全部)
# 为了简单,我们返回 ['inbound_semi:*'],在过滤函数中特殊处理
return ['inbound_semi:*']