diff --git a/changelog/17124.txt b/changelog/17124.txt new file mode 100644 index 000000000..ef4f116d9 --- /dev/null +++ b/changelog/17124.txt @@ -0,0 +1,2 @@ +```release-note:bug +ui: Fix kv deleting the latest version when not allowed to soft delete (and delete a specific version of a secret) \ No newline at end of file diff --git a/ui/app/components/secret-delete-menu.js b/ui/app/components/secret-delete-menu.js index cc9ae6bf9..ab8bd5754 100644 --- a/ui/app/components/secret-delete-menu.js +++ b/ui/app/components/secret-delete-menu.js @@ -129,7 +129,7 @@ export default class SecretDeleteMenu extends Component { }); } else { // if they do not have read access on the metadata endpoint we need to pull the version from modelForData so they can perform delete and undelete operations - // only perform if no access to metatdata otherwise it will only delete latest version for any deleteType === delete + // only perform if no access to metadata otherwise it will only delete latest version for any deleteType === delete let currentVersionForNoReadMetadata; if (!this.args.canReadSecretMetadata) { currentVersionForNoReadMetadata = this.args.modelForData?.version; diff --git a/ui/app/templates/components/secret-delete-menu.hbs b/ui/app/templates/components/secret-delete-menu.hbs index d474ce081..11b1fda7f 100644 --- a/ui/app/templates/components/secret-delete-menu.hbs +++ b/ui/app/templates/components/secret-delete-menu.hbs @@ -57,12 +57,21 @@ @onChange={{fn (mut this.deleteType)}} />
- This deletes Version - {{@modelForData.version}} - of the secret. It can be un-deleted later. -
+ {{#if this.canSoftDeleteSecretData}} + ++ This deletes Version + {{@modelForData.version}} + of the secret. It can be un-deleted later. +
+ {{else}} + ++ Your policy does not allow deleting a specific version of this secret. This will delete the + latest version + of this secret. It can be un-deleted later. +
+ {{/if}}