Skip to content

Commit

Permalink
iam:fix get account use_sys_org.
Browse files Browse the repository at this point in the history
  • Loading branch information
ljl committed Dec 11, 2023
1 parent 14720a8 commit 1ddb17a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions support/iam/src/basic/serv/iam_account_serv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<RbumRelBoneResp> = vec![];
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion support/iam/src/console_app/api/iam_ca_account_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl IamCaAccountApi {
async fn get(&self, id: Path<String>, ctx: TardisContextExtractor, request: &Request) -> TardisApiResult<IamAccountDetailAggResp> {
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)
}
Expand Down
4 changes: 2 additions & 2 deletions support/iam/src/console_system/api/iam_cs_account_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ impl IamCsAccountApi {
},
..Default::default()
},
true,
true,
tenant_id.0.is_none(),
tenant_id.0.is_none(),
&funs,
&ctx,
)
Expand Down

0 comments on commit 1ddb17a

Please sign in to comment.