Skip to content

Commit

Permalink
Show generate creds for static-roles when you have read permissions (h…
Browse files Browse the repository at this point in the history
…ashicorp#19190)

* fix, need to test and write test for

* the fix

* add test coverage

* changelog:

* woops param already existed

* remove test coverage

* Delete database-role-edit-test.js
  • Loading branch information
Monkeychip authored Feb 16, 2023
1 parent 184939e commit 6946556
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changelog/19190.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
ui: show Get credentials button for static roles detail page when a user has the proper permissions.
```
9 changes: 7 additions & 2 deletions ui/app/templates/components/database-role-edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,17 @@
Rotate credentials
</button>
{{/if}}
{{#if @model.canGenerateCredentials}}
{{#if
(or
(and (eq @model.type "static") @model.canGetCredentials)
(and (eq @model.type "dynamic") @model.canGenerateCredentials)
)
}}
<button
type="button"
class="toolbar-link"
{{on "click" (fn this.generateCreds @model.id @model.type)}}
data-test-database-role-generate-creds
data-test-database-role-creds={{@model.type}}
>
{{if (eq @model.type "static") "Get credentials" "Generate credentials"}}
</button>
Expand Down

0 comments on commit 6946556

Please sign in to comment.