自动赋予 000001 所有权限
This commit is contained in:
@@ -126,6 +126,16 @@ def verify_kefu_permission(request, username_from_frontend=None):
|
||||
if current_user.IsSuperuser and '000001' not in permissions:
|
||||
permissions.insert(0, '000001')
|
||||
|
||||
# 拥有 000001(超级管理权限)的用户自动获得所有功能权限码
|
||||
if '000001' in permissions:
|
||||
_ALL_FEATURE_PERMS = {
|
||||
'bankuai', 'caiwu', 'huiyuancaiwu', 'dingdancaiwu',
|
||||
'qtczcaiwu', 'kaohepeizhi',
|
||||
}
|
||||
for p in _ALL_FEATURE_PERMS:
|
||||
if p not in permissions:
|
||||
permissions.append(p)
|
||||
|
||||
if not permissions:
|
||||
logger.warning(f"用户 {current_user.Phone} 没有任何权限,请检查角色分配")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user