From bd7a61b32f65b9926c69204ae46049d7c504515d Mon Sep 17 00:00:00 2001 From: claire bontempo <68122737+hellobontempo@users.noreply.github.com> Date: Fri, 1 Apr 2022 16:05:42 -0500 Subject: [PATCH] UI/Only show form values if have read access (#14794) * only show value in edit form if has read capabilities * revert messing with form * delete secret data from secret * add check for selected version * remove added line * add changelog --- changelog/14794.txt | 3 +++ ui/app/components/secret-create-or-update.js | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 changelog/14794.txt diff --git a/changelog/14794.txt b/changelog/14794.txt new file mode 100644 index 000000000..fb4549222 --- /dev/null +++ b/changelog/14794.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: Fix KV secret showing in the edit form after a user creates a new version but doesn't have read capabilities +``` \ No newline at end of file diff --git a/ui/app/components/secret-create-or-update.js b/ui/app/components/secret-create-or-update.js index 05f97327e..ea7ba0309 100644 --- a/ui/app/components/secret-create-or-update.js +++ b/ui/app/components/secret-create-or-update.js @@ -129,6 +129,9 @@ export default class SecretCreateOrUpdate extends Component { return secretData .save() .then(() => { + if (!this.args.canReadSecretData && secret.selectedVersion) { + delete secret.selectedVersion.secretData; + } if (!secretData.isError) { if (isV2) { secret.set('id', key);