fix: kefu permissions use legacy permission table instead of gvsdsdk

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-06-28 23:59:32 +08:00
parent c336a893a0
commit 42cb117a8a
6 changed files with 183 additions and 207 deletions

View File

@@ -101,6 +101,22 @@ def is_system_super_admin(user):
)
def is_kefu_backend_account(user):
"""可登录客服后台:超管 / UserType=kefu / KefuProfile / 旧表 user_role 有绑定。"""
if is_system_super_admin(user):
return True
if getattr(user, 'UserType', '') == 'kefu':
return True
try:
kefu = user.KefuProfile
if kefu.zhuangtai == 1:
return True
except Exception:
pass
from backend.utils import has_legacy_backend_binding
return has_legacy_backend_binding(user)
def can_manage_admin_assignments(user, permissions=None):
"""是否可维护数据范围任职、俱乐部密钥等集团级配置(不含俱乐部 000001"""
if is_system_super_admin(user):