fix: 平台超管拥有全部商户数据范围
This commit is contained in:
@@ -13,6 +13,7 @@ const (
|
|||||||
RegionSpilt = " / " // 地区分隔符
|
RegionSpilt = " / " // 地区分隔符
|
||||||
Unknown = "Unknown" // Unknown
|
Unknown = "Unknown" // Unknown
|
||||||
SuperRoleKey = "super" // 超管角色唯一标识符,通过角色验证超管
|
SuperRoleKey = "super" // 超管角色唯一标识符,通过角色验证超管
|
||||||
|
ImPlatformRoleKey = "supreme_manager" // IM平台超管角色唯一标识符
|
||||||
MaxServeLogContentLen = 2048 // 最大保留服务日志内容大小
|
MaxServeLogContentLen = 2048 // 最大保留服务日志内容大小
|
||||||
SysDefaultLanguage = "zh_CN" // 系统默认语言,当配置文件没有国际化配置时生效
|
SysDefaultLanguage = "zh_CN" // 系统默认语言,当配置文件没有国际化配置时生效
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -71,6 +71,9 @@ func isImPlatformAdmin(ctx context.Context, operatorId int64) bool {
|
|||||||
if service.AdminMember().VerifySuperId(ctx, operatorId) {
|
if service.AdminMember().VerifySuperId(ctx, operatorId) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
if contexts.GetRoleKey(ctx) == consts.ImPlatformRoleKey {
|
||||||
|
return true
|
||||||
|
}
|
||||||
return contexts.IsCompanyDept(ctx) && contexts.GetTenantId(ctx) <= 0
|
return contexts.IsCompanyDept(ctx) && contexts.GetTenantId(ctx) <= 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user