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
This commit is contained in:
claire bontempo 2022-04-01 16:05:42 -05:00 committed by GitHub
parent 95555b9dd4
commit bd7a61b32f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

3
changelog/14794.txt Normal file
View File

@ -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
```

View File

@ -129,6 +129,9 @@ export default class SecretCreateOrUpdate extends Component {
return secretData return secretData
.save() .save()
.then(() => { .then(() => {
if (!this.args.canReadSecretData && secret.selectedVersion) {
delete secret.selectedVersion.secretData;
}
if (!secretData.isError) { if (!secretData.isError) {
if (isV2) { if (isV2) {
secret.set('id', key); secret.set('id', key);