Skip to content

Commit

Permalink
Add collection.manage property
Browse files Browse the repository at this point in the history
  • Loading branch information
eliykat committed Oct 22, 2024
1 parent f7202ab commit 9e53da2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/bitwarden-vault/src/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub struct Collection {
pub external_id: Option<String>,
pub hide_passwords: bool,
pub read_only: bool,
pub manage: bool,
}

#[derive(Serialize, Deserialize, Debug, JsonSchema)]
Expand All @@ -35,6 +36,7 @@ pub struct CollectionView {
pub external_id: Option<String>,
pub hide_passwords: bool,
pub read_only: bool,
pub manage: bool,
}

impl LocateKey for Collection {
Expand All @@ -57,6 +59,7 @@ impl KeyDecryptable<SymmetricCryptoKey, CollectionView> for Collection {
external_id: self.external_id.clone(),
hide_passwords: self.hide_passwords,
read_only: self.read_only,
manage: self.manage,
})
}
}
Expand All @@ -72,6 +75,7 @@ impl TryFrom<CollectionDetailsResponseModel> 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),

Check warning on line 78 in crates/bitwarden-vault/src/collection.rs

View check run for this annotation

Codecov / codecov/patch

crates/bitwarden-vault/src/collection.rs#L78

Added line #L78 was not covered by tests
})
}
}
2 changes: 2 additions & 0 deletions crates/bitwarden-vault/src/mobile/client_collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -74,6 +75,7 @@ mod tests {
external_id: None,
hide_passwords: false,
read_only: false,
manage: false,
}).unwrap();

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

0 comments on commit 9e53da2

Please sign in to comment.