mirror of
https://github.com/dani-garcia/vaultwarden.wiki.git
synced 2026-10-28 11:06:47 +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:
1 parent
85bc5514f8
commit
92236394e6
4 files changed
+39
-35
No files matched your search
@@ -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