Browse Source
Merge pull request #3606 from farodin91/add-group-import-on-invite
Add group import on invite
pull/3608/head
Mathijs van Veluw
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
0 deletions
-
src/api/core/organizations.rs
|
@ -849,6 +849,7 @@ struct CollectionData { |
|
|
#[allow(non_snake_case)] |
|
|
#[allow(non_snake_case)] |
|
|
struct InviteData { |
|
|
struct InviteData { |
|
|
Emails: Vec<String>, |
|
|
Emails: Vec<String>, |
|
|
|
|
|
Groups: Vec<String>, |
|
|
Type: NumberOrString, |
|
|
Type: NumberOrString, |
|
|
Collections: Option<Vec<CollectionData>>, |
|
|
Collections: Option<Vec<CollectionData>>, |
|
|
AccessAll: Option<bool>, |
|
|
AccessAll: Option<bool>, |
|
@ -928,6 +929,11 @@ async fn send_invite( |
|
|
|
|
|
|
|
|
new_user.save(&mut conn).await?; |
|
|
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( |
|
|
log_event( |
|
|
EventType::OrganizationUserInvited as i32, |
|
|
EventType::OrganizationUserInvited as i32, |
|
|
&new_user.uuid, |
|
|
&new_user.uuid, |
|
|