Skip to content

Commit 9e53da2

Browse files
committed
Add collection.manage property
1 parent f7202ab commit 9e53da2

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

crates/bitwarden-vault/src/collection.rs

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ pub struct Collection {
2121
pub external_id: Option<String>,
2222
pub hide_passwords: bool,
2323
pub read_only: bool,
24+
pub manage: bool,
2425
}
2526

2627
#[derive(Serialize, Deserialize, Debug, JsonSchema)]
@@ -35,6 +36,7 @@ pub struct CollectionView {
3536
pub external_id: Option<String>,
3637
pub hide_passwords: bool,
3738
pub read_only: bool,
39+
pub manage: bool,
3840
}
3941

4042
impl LocateKey for Collection {
@@ -57,6 +59,7 @@ impl KeyDecryptable<SymmetricCryptoKey, CollectionView> for Collection {
5759
external_id: self.external_id.clone(),
5860
hide_passwords: self.hide_passwords,
5961
read_only: self.read_only,
62+
manage: self.manage,
6063
})
6164
}
6265
}
@@ -72,6 +75,7 @@ impl TryFrom<CollectionDetailsResponseModel> for Collection {
7275
external_id: collection.external_id,
7376
hide_passwords: collection.hide_passwords.unwrap_or(false),
7477
read_only: collection.read_only.unwrap_or(false),
78+
manage: collection.manage.unwrap_or(false),
7579
})
7680
}
7781
}

crates/bitwarden-vault/src/mobile/client_collection.rs

+2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ mod tests {
5858
external_id: None,
5959
hide_passwords: false,
6060
read_only: false,
61+
manage: false,
6162
}]).unwrap();
6263

6364
assert_eq!(dec[0].name, "Default collection");
@@ -74,6 +75,7 @@ mod tests {
7475
external_id: None,
7576
hide_passwords: false,
7677
read_only: false,
78+
manage: false,
7779
}).unwrap();
7880

7981
assert_eq!(dec.name, "Default collection");

0 commit comments

Comments
 (0)