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:
@ -221,6 +221,15 @@ class AuthService:
|
||||
'elements': ['inbound_buy:unit_price', ...]
|
||||
}
|
||||
"""
|
||||
# 超级管理员返回所有权限(通配符)
|
||||
from app.utils.constants import UserRole
|
||||
if role_code == UserRole.SUPER_ADMIN:
|
||||
# 返回通配符,表示拥有所有菜单和元素权限
|
||||
return {
|
||||
'menus': ['*'],
|
||||
'elements': ['*']
|
||||
}
|
||||
|
||||
# 1. 查菜单权限
|
||||
menu_perms = SysRolePermission.query.filter_by(
|
||||
role_code=role_code,
|
||||
@ -243,4 +252,4 @@ class AuthService:
|
||||
return {
|
||||
'menus': menu_codes,
|
||||
'elements': element_codes
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user