revert: restore gvsdsdk role/permission APIs; keep KefuProfile login fix
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -102,19 +102,15 @@ def is_system_super_admin(user):
|
||||
|
||||
|
||||
def is_kefu_backend_account(user):
|
||||
"""可登录客服后台:超管 / UserType=kefu / KefuProfile / 旧表 user_role 有绑定。"""
|
||||
"""可登录客服后台:超管 / UserType=kefu / 有正常 KefuProfile。"""
|
||||
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
|
||||
return user.KefuProfile.zhuangtai == 1
|
||||
except Exception:
|
||||
pass
|
||||
from backend.utils import has_legacy_backend_binding
|
||||
return has_legacy_backend_binding(user)
|
||||
return False
|
||||
|
||||
|
||||
def can_manage_admin_assignments(user, permissions=None):
|
||||
|
||||
Reference in New Issue
Block a user