From e818a0bf3778e9bea818d00d548280bc4e45b69e Mon Sep 17 00:00:00 2001 From: Jan Jansen Date: Thu, 22 Jun 2023 11:10:40 +0200 Subject: [PATCH] Add group import on invite Fixes #3599 Signed-off-by: Jan Jansen --- src/api/core/organizations.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/api/core/organizations.rs b/src/api/core/organizations.rs index c3e98973..551656c0 100644 --- a/src/api/core/organizations.rs +++ b/src/api/core/organizations.rs @@ -849,6 +849,7 @@ struct CollectionData { #[allow(non_snake_case)] struct InviteData { Emails: Vec, + Groups: Vec, Type: NumberOrString, Collections: Option>, AccessAll: Option, @@ -928,6 +929,11 @@ async fn send_invite( new_user.save(&mut conn).await?; + for group in data.Groups.iter() { + let mut group_entry = GroupUser::new(String::from(group), user.uuid.clone()); + group_entry.save(&mut conn).await?; + } + log_event( EventType::OrganizationUserInvited as i32, &new_user.uuid,