Browse Source

make access_all optional

pull/4812/head
Stefan Melmuk 9 months ago
parent
commit
0faebb69b4
No known key found for this signature in database GPG Key ID: 817020C608FE9C09
  1. 6
      src/api/core/organizations.rs

6
src/api/core/organizations.rs

@ -1297,7 +1297,7 @@ struct EditUserData {
r#type: NumberOrString,
collections: Option<Vec<CollectionData>>,
groups: Option<Vec<String>>,
access_all: bool,
access_all: Option<bool>,
}
#[put("/organizations/<org_id>/users/<org_user_id>", data = "<data>", rank = 1)]
@ -1370,7 +1370,7 @@ async fn edit_user(
}
}
user_to_edit.access_all = data.access_all;
user_to_edit.access_all = data.access_all.unwrap_or(false);
user_to_edit.atype = new_type as i32;
// Delete all the odd collections
@ -1379,7 +1379,7 @@ async fn edit_user(
}
// If no accessAll, add the collections received
if !data.access_all {
if !data.access_all.unwrap_or(false) {
for col in data.collections.iter().flatten() {
match Collection::find_by_uuid_and_org(&col.id, org_id, &mut conn).await {
None => err!("Collection not found in Organization"),

Loading…
Cancel
Save