1
0
Fork 1
Spiegel von https://github.com/dani-garcia/vaultwarden.git synchronisiert 2024-11-22 05:10:29 +01:00

Error on invalid collection ID in post_collections_admin

Dieser Commit ist enthalten in:
Miroslav Prasil 2018-05-11 11:45:55 +01:00
Ursprung e5c9d19e25
Commit 9cf449e1c5

Datei anzeigen

@ -322,7 +322,7 @@ fn post_collections_admin(uuid: String, data: Json<CollectionsAdminData>, header
for collection in posted_collections.symmetric_difference(&current_collections) {
match Collection::find_by_uuid(&collection, &conn) {
None => (), // Does not exist, what now?
None => err!("Invalid collection ID provided"),
Some(collection) => {
if collection.is_writable_by_user(&headers.user.uuid, &conn) {
if posted_collections.contains(&collection.uuid) { // Add to collection
@ -330,6 +330,8 @@ fn post_collections_admin(uuid: String, data: Json<CollectionsAdminData>, header
} else { // Remove from collection
CollectionCipher::delete(&cipher.uuid, &collection.uuid, &conn);
}
} else {
err!("No rights to modify the collection")
}
}
}