Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2024-11-22 05:10:29 +01:00
Remove unnecessary test and rewrite match
Dieser Commit ist enthalten in:
Ursprung
f43d329e22
Commit
3b537f70ac
1 geänderte Dateien mit 6 neuen und 9 gelöschten Zeilen
|
@ -352,16 +352,13 @@ fn post_cipher_share(uuid: String, data: Json<ShareCipherData>, headers: Headers
|
||||||
let data: ShareCipherData = data.into_inner();
|
let data: ShareCipherData = data.into_inner();
|
||||||
|
|
||||||
let mut cipher = match Cipher::find_by_uuid(&uuid, &conn) {
|
let mut cipher = match Cipher::find_by_uuid(&uuid, &conn) {
|
||||||
Some(cipher) => match cipher.uuid == uuid {
|
Some(cipher) => {
|
||||||
true => {
|
|
||||||
if cipher.is_write_accessible_to_user(&headers.user.uuid, &conn) {
|
if cipher.is_write_accessible_to_user(&headers.user.uuid, &conn) {
|
||||||
cipher
|
cipher
|
||||||
} else {
|
} else {
|
||||||
err!("Cipher is not write accessible")
|
err!("Cipher is not write accessible")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
false => err!("Wrong Cipher id provided")
|
|
||||||
},
|
|
||||||
None => err!("Cipher doesn't exist")
|
None => err!("Cipher doesn't exist")
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Laden …
In neuem Issue referenzieren