Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-13910] Add collection manage property #4

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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 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 @@
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 @@
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
Loading