From 8f11765b960cf780ab359fff90eee7e20760bd1a Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 8 Sep 2021 14:31:16 -0400 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20redirect=20to=20index?= =?UTF-8?q?=20on=20save=20in=20create-without-read=20case?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../credential-store/credential-libraries.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ui/admin/app/routes/scopes/scope/credential-stores/credential-store/credential-libraries.js b/ui/admin/app/routes/scopes/scope/credential-stores/credential-store/credential-libraries.js index 06748f330..d38d9a2f9 100644 --- a/ui/admin/app/routes/scopes/scope/credential-stores/credential-store/credential-libraries.js +++ b/ui/admin/app/routes/scopes/scope/credential-stores/credential-store/credential-libraries.js @@ -55,10 +55,16 @@ export default class ScopesScopeCredentialStoresCredentialStoreCredentialLibrari ) async save(credentialLibrary) { await credentialLibrary.save(); - await this.transitionTo( - 'scopes.scope.credential-stores.credential-store.credential-libraries.credential-library', - credentialLibrary - ); + if (this.can.can('read model', credentialLibrary)) { + await this.transitionTo( + 'scopes.scope.credential-stores.credential-store.credential-libraries.credential-library', + credentialLibrary + ); + } else { + await this.transitionTo( + 'scopes.scope.credential-stores.credential-store.credential-libraries' + ); + } this.refresh(); }