diff --git a/server/internal/consts/debris.go b/server/internal/consts/debris.go index 531c34c..1d91b51 100644 --- a/server/internal/consts/debris.go +++ b/server/internal/consts/debris.go @@ -13,6 +13,7 @@ const ( RegionSpilt = " / " // 地区分隔符 Unknown = "Unknown" // Unknown SuperRoleKey = "super" // 超管角色唯一标识符,通过角色验证超管 + ImPlatformRoleKey = "supreme_manager" // IM平台超管角色唯一标识符 MaxServeLogContentLen = 2048 // 最大保留服务日志内容大小 SysDefaultLanguage = "zh_CN" // 系统默认语言,当配置文件没有国际化配置时生效 ) diff --git a/server/internal/logic/sys/im_admin_scope.go b/server/internal/logic/sys/im_admin_scope.go index 6091cd5..054e367 100644 --- a/server/internal/logic/sys/im_admin_scope.go +++ b/server/internal/logic/sys/im_admin_scope.go @@ -71,6 +71,9 @@ func isImPlatformAdmin(ctx context.Context, operatorId int64) bool { if service.AdminMember().VerifySuperId(ctx, operatorId) { return true } + if contexts.GetRoleKey(ctx) == consts.ImPlatformRoleKey { + return true + } return contexts.IsCompanyDept(ctx) && contexts.GetTenantId(ctx) <= 0 }