From 3800954c4cb5540c858fb8f282c22e0fa2e25d24 Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Tue, 22 Oct 2024 20:27:03 +1000 Subject: [PATCH] [PM-13910] Add collection.manage property (#4) --- crates/bitwarden-vault/src/collection.rs | 4 ++++ crates/bitwarden-vault/src/mobile/client_collection.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/crates/bitwarden-vault/src/collection.rs b/crates/bitwarden-vault/src/collection.rs index 5e0fcbdc..ce798d92 100644 --- a/crates/bitwarden-vault/src/collection.rs +++ b/crates/bitwarden-vault/src/collection.rs @@ -21,6 +21,7 @@ pub struct Collection { pub external_id: Option, pub hide_passwords: bool, pub read_only: bool, + pub manage: bool, } #[derive(Serialize, Deserialize, Debug, JsonSchema)] @@ -35,6 +36,7 @@ pub struct CollectionView { pub external_id: Option, pub hide_passwords: bool, pub read_only: bool, + pub manage: bool, } impl LocateKey for Collection { @@ -57,6 +59,7 @@ impl KeyDecryptable for Collection { external_id: self.external_id.clone(), hide_passwords: self.hide_passwords, read_only: self.read_only, + manage: self.manage, }) } } @@ -72,6 +75,7 @@ impl TryFrom for Collection { external_id: collection.external_id, hide_passwords: collection.hide_passwords.unwrap_or(false), read_only: collection.read_only.unwrap_or(false), + manage: collection.manage.unwrap_or(false), }) } } diff --git a/crates/bitwarden-vault/src/mobile/client_collection.rs b/crates/bitwarden-vault/src/mobile/client_collection.rs index a3d6ee61..0c007f9e 100644 --- a/crates/bitwarden-vault/src/mobile/client_collection.rs +++ b/crates/bitwarden-vault/src/mobile/client_collection.rs @@ -58,6 +58,7 @@ mod tests { external_id: None, hide_passwords: false, read_only: false, + manage: false, }]).unwrap(); assert_eq!(dec[0].name, "Default collection"); @@ -74,6 +75,7 @@ mod tests { external_id: None, hide_passwords: false, read_only: false, + manage: false, }).unwrap(); assert_eq!(dec.name, "Default collection");