Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

always show secrets tab in the main nav #6477

Merged
merged 2 commits into from
Mar 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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