mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2024-11-24 13:55:40 +03:00
Add group import on invite
Fixes #3599 Signed-off-by: Jan Jansen <jan.jansen@gdata.de>
This commit is contained in:
parent
2aedff50e8
commit
e818a0bf37
1 changed files with 6 additions and 0 deletions
|
@ -849,6 +849,7 @@ struct CollectionData {
|
|||
#[allow(non_snake_case)]
|
||||
struct InviteData {
|
||||
Emails: Vec<String>,
|
||||
Groups: Vec<String>,
|
||||
Type: NumberOrString,
|
||||
Collections: Option<Vec<CollectionData>>,
|
||||
AccessAll: Option<bool>,
|
||||
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue