mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-06-12 05:07:40 +02:00
Delete folder mappings when deleting folders and make sure that we can't change a ciphers owner when created
This commit is contained in:
@ -89,10 +89,10 @@ fn delete_folder(uuid: String, headers: Headers, conn: DbConn) -> EmptyResult {
|
||||
err!("Folder belongs to another user")
|
||||
}
|
||||
|
||||
if !Cipher::find_by_folder(&folder.uuid, &conn).is_empty() {
|
||||
err!("Folder is not empty")
|
||||
}
|
||||
// Delete FolderCipher mappings
|
||||
for fc in FolderCipher::find_by_folder(&uuid, &conn) { fc.delete(&conn).expect("Error deleting mapping"); }
|
||||
|
||||
// Delete the actual folder entry
|
||||
folder.delete(&conn);
|
||||
|
||||
Ok(())
|
||||
|
Reference in New Issue
Block a user