From 273973a86ac04e8add2721e06f4e511168e626f5 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 5 Feb 2024 12:32:14 +0100 Subject: [PATCH] fix: auto-add user add user to the group all --- backend/windmill-api/src/workspaces.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/backend/windmill-api/src/workspaces.rs b/backend/windmill-api/src/workspaces.rs index 54edbe9912..71a2d87c94 100644 --- a/backend/windmill-api/src/workspaces.rs +++ b/backend/windmill-api/src/workspaces.rs @@ -844,6 +844,25 @@ async fn auto_add_user( .execute(&mut **tx) .await?; + sqlx::query_as!( + Group, + "INSERT INTO usr_to_group (workspace_id, usr, group_) VALUES ($1, $2, $3) ON CONFLICT DO NOTHING", + &w_id, + username, + "all", + ) + .execute(&mut **tx) + .await?; + audit_log( + &mut **tx, + &username, + "users.auto_invite_add", + ActionKind::Create, + &w_id, + Some(email), + None, + ) + .await?; Ok(()) }