Add Policy-based Navigation (#5967)

* add permissions service

* start template helper

* match prefixed paths

* gate sidebar links

* land on first page user has access to

* show nav when user first logs in

* clear paths when user logs out

* add tests

* implement feedback

* show all nav items if no policy is found

* update onboarding wizard

* fix some unrelated tests

* add support for namespaces

* gate wizard

* unstage package and lockfile
This commit is contained in:
Noelle Daley
2019-01-18 14:04:40 -08:00
committed by GitHub
parent b436df67e9
commit 20deed3a3d
23 changed files with 725 additions and 239 deletions

View File

@@ -48,18 +48,17 @@ module('Integration | Component | auth form', function(hooks) {
hooks.beforeEach(function() {
this.owner.lookup('service:csp-event').attach();
component.setContext(this);
this.owner.register('service:router', routerService);
this.router = this.owner.lookup('service:router');
});
hooks.afterEach(function() {
this.owner.lookup('service:csp-event').remove();
component.removeContext();
});
const CSP_ERR_TEXT = `Error This is a standby Vault node but can't communicate with the active node via request forwarding. Sign in at the active node to use the Vault UI.`;
test('it renders error on CSP violation', async function(assert) {
this.owner.unregister('service:auth');
this.owner.register('service:auth', authService);
this.auth = this.owner.lookup('service:auth');
this.set('cluster', EmberObject.create({ standby: true }));
@@ -156,6 +155,7 @@ module('Integration | Component | auth form', function(hooks) {
});
test('it calls authenticate with the correct path', async function(assert) {
this.owner.unregister('service:auth');
this.owner.register('service:auth', workingAuthService);
this.auth = this.owner.lookup('service:auth');
let authSpy = sinon.spy(this.get('auth'), 'authenticate');