Skip to content

Commit

Permalink
always show secrets tab in the main nav (#6477)
Browse files Browse the repository at this point in the history
* always show secrets tab in the main nav

* remove secrets key from permissions service
  • Loading branch information
meirish committed Mar 26, 2019
1 parent c232d3f commit 9ba0372
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 28 deletions.
1 change: 0 additions & 1 deletion ui/app/services/permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import Service, { inject as service } from '@ember/service';
import { task } from 'ember-concurrency';

const API_PATHS = {
secrets: { engine: 'cubbyhole/' },
access: {
methods: 'sys/auth',
entities: 'identity/entities',
Expand Down
22 changes: 10 additions & 12 deletions ui/app/templates/vault/cluster.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,16 @@
</NamespacePicker>
</li>
{{/if}}
{{#if (has-permission 'secrets')}}
<li class="{{if (is-active-route 'vault.cluster.secrets') 'is-active'}}">
{{#link-to
"vault.cluster.secrets"
current-when="vault.cluster.secrets vault.cluster.settings.mount-secret-backend vault.cluster.settings.configure-secret-backend"
invokeAction=(action Nav.closeDrawer)
data-test-navbar-item='secrets'
}}
Secrets
{{/link-to}}
</li>
{{/if}}
<li class="{{if (is-active-route 'vault.cluster.secrets') 'is-active'}}">
{{#link-to
"vault.cluster.secrets"
current-when="vault.cluster.secrets vault.cluster.settings.mount-secret-backend vault.cluster.settings.configure-secret-backend"
invokeAction=(action Nav.closeDrawer)
data-test-navbar-item='secrets'
}}
Secrets
{{/link-to}}
</li>
{{#if (has-permission 'access')}}
<li class="{{if (is-active-route 'vault.cluster.access') 'is-active'}}">
{{#link-to
Expand Down
15 changes: 0 additions & 15 deletions ui/tests/acceptance/cluster-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,6 @@ module('Acceptance | cluster', function(hooks) {
await logout.visit();
});

test('shows nav item if user does have permission', async function(assert) {
const read_secrets_policy = `'
path "cubbyhole/" {
capabilities = ["read"]
},
'`;

const userToken = await tokenWithPolicy('show-secrets-nav', read_secrets_policy);
await logout.visit();
await authPage.login(userToken);

assert.dom('[data-test-navbar-item=secrets]').exists();
await logout.visit();
});

test('enterprise nav item links to first route that user has access to', async function(assert) {
const read_rgp_policy = `'
path "sys/policies/rgp" {
Expand Down

0 comments on commit 9ba0372

Please sign in to comment.