From 1ddb17aad110b6c0b9d8f742ea7c3cee9c23fc29 Mon Sep 17 00:00:00 2001 From: ljl <17743125563@163.com> Date: Mon, 11 Dec 2023 21:12:28 +0800 Subject: [PATCH] iam:fix get account use_sys_org. --- support/iam/src/basic/serv/iam_account_serv.rs | 6 ++++-- support/iam/src/console_app/api/iam_ca_account_api.rs | 2 +- support/iam/src/console_system/api/iam_cs_account_api.rs | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/support/iam/src/basic/serv/iam_account_serv.rs b/support/iam/src/basic/serv/iam_account_serv.rs index 08dc6d3fc..985c526fb 100644 --- a/support/iam/src/basic/serv/iam_account_serv.rs +++ b/support/iam/src/basic/serv/iam_account_serv.rs @@ -442,7 +442,8 @@ impl IamAccountServ { let set_id = if use_sys_org { IamSetServ::get_set_id_by_code(&IamSetServ::get_default_code(&IamSetKind::Org, ""), true, funs, ctx).await? } else { - IamSetServ::get_default_set_id_by_ctx(&IamSetKind::Org, funs, ctx).await? + IamSetServ::get_set_id_by_code(&IamSetServ::get_default_code(&IamSetKind::Org, &IamTenantServ::get_id_by_ctx(ctx, funs)?), true, funs, ctx).await? + // IamSetServ::get_default_set_id_by_ctx(&IamSetKind::Org, funs, ctx).await? }; let raw_roles = Self::find_simple_rel_roles(&account.id, true, Some(true), None, funs, ctx).await?; let mut roles: Vec = vec![]; @@ -564,7 +565,8 @@ impl IamAccountServ { let set_id = if use_sys_org { IamSetServ::get_set_id_by_code(&IamSetServ::get_default_code(&IamSetKind::Org, ""), true, funs, ctx).await? } else { - IamSetServ::get_default_set_id_by_ctx(&IamSetKind::Org, funs, ctx).await? + IamSetServ::get_set_id_by_code(&IamSetServ::get_default_code(&IamSetKind::Org, &IamTenantServ::get_id_by_ctx(ctx, funs)?), true, funs, ctx).await? + // IamSetServ::get_default_set_id_by_ctx(&IamSetKind::Org, funs, ctx).await? }; for account in accounts.records { account_aggs.push(IamAccountSummaryAggResp { diff --git a/support/iam/src/console_app/api/iam_ca_account_api.rs b/support/iam/src/console_app/api/iam_ca_account_api.rs index f432e8a09..f1b796ea0 100644 --- a/support/iam/src/console_app/api/iam_ca_account_api.rs +++ b/support/iam/src/console_app/api/iam_ca_account_api.rs @@ -27,7 +27,7 @@ impl IamCaAccountApi { async fn get(&self, id: Path, ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { add_remote_ip(request, &ctx.0).await?; let funs = iam_constants::get_tardis_inst(); - let result = IamAccountServ::get_account_detail_aggs(&id.0, &IamAccountFilterReq::default(), true, false, &funs, &ctx.0).await?; + let result = IamAccountServ::get_account_detail_aggs(&id.0, &IamAccountFilterReq::default(), false, true, &funs, &ctx.0).await?; ctx.0.execute_task().await?; TardisResp::ok(result) } diff --git a/support/iam/src/console_system/api/iam_cs_account_api.rs b/support/iam/src/console_system/api/iam_cs_account_api.rs index 89b247a31..34c2210e1 100644 --- a/support/iam/src/console_system/api/iam_cs_account_api.rs +++ b/support/iam/src/console_system/api/iam_cs_account_api.rs @@ -81,8 +81,8 @@ impl IamCsAccountApi { }, ..Default::default() }, - true, - true, + tenant_id.0.is_none(), + tenant_id.0.is_none(), &funs, &ctx, )