diff --git a/crates/bws/CHANGELOG.md b/crates/bws/CHANGELOG.md index 447f7cad6..695ab43df 100644 --- a/crates/bws/CHANGELOG.md +++ b/crates/bws/CHANGELOG.md @@ -7,6 +7,10 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added + +- The ability to edit unassigned secrets with direct permissions. (#906) + ### Removed - The deprecated `action type` commands are now removed. Please use `type action` instead. (#836) diff --git a/crates/bws/src/command/secret.rs b/crates/bws/src/command/secret.rs index 794a1a0b9..0f1aa3981 100644 --- a/crates/bws/src/command/secret.rs +++ b/crates/bws/src/command/secret.rs @@ -171,13 +171,10 @@ pub(crate) async fn edit( key: secret.key.unwrap_or(old_secret.key), value: secret.value.unwrap_or(old_secret.value), note: secret.note.unwrap_or(old_secret.note), - project_ids: match secret.project_id { - Some(id) => Some(vec![id]), - None => match old_secret.project_id { - Some(id) => Some(vec![id]), - None => bail!("Editing a secret requires a project_id."), - }, - }, + project_ids: secret + .project_id + .or(old_secret.project_id) + .map(|id| vec![id]), }) .await?; serialize_response(new_secret, output_settings);