{"action":"created","issue":{"url":"https://api.github.com/repos/aurelia/router/issues/216","labels_url":"https://api.github.com/repos/aurelia/router/issues/216/labels{/name}","comments_url":"https://api.github.com/repos/aurelia/router/issues/216/comments","events_url":"https://api.github.com/repos/aurelia/router/issues/216/events","html_url":"https://github.com/aurelia/router/issues/216","id":107904012,"number":216,"title":"Refresh the navigation routes","user":{"login":"heruan","id":851745,"avatar_url":"https://avatars.githubusercontent.com/u/851745?v=3","gravatar_id":"","url":"https://api.github.com/users/heruan","html_url":"https://github.com/heruan","followers_url":"https://api.github.com/users/heruan/followers","following_url":"https://api.github.com/users/heruan/following{/other_user}","gists_url":"https://api.github.com/users/heruan/gists{/gist_id}","starred_url":"https://api.github.com/users/heruan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heruan/subscriptions","organizations_url":"https://api.github.com/users/heruan/orgs","repos_url":"https://api.github.com/users/heruan/repos","events_url":"https://api.github.com/users/heruan/events{/privacy}","received_events_url":"https://api.github.com/users/heruan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-23T11:54:54Z","updated_at":"2015-09-23T12:17:07Z","closed_at":null,"body":"I'm writing a Security Manager for my project in Aurelia and I'm trying to fit it well with Aurelia's router. Instead of dealing with `if`s in HTML views, I'd like to use the `nav` property of routes configuration to include/exclude routes from the `navigation` array; i.e.\r\n```javascript\r\nconfig.map([\r\n  {\r\n    name: \"home\",\r\n    route: \"\",\r\n    moduleId: \"./home\",\r\n    nav: true // always visible\r\n  }, {\r\n    name: \"login\",\r\n    route: \"login\",\r\n    moduleId: \"./login\",\r\n    nav: !this.securityContext.isUserAuthenticated(), // if user is not authenticated\r\n    title: 'Sign-in'\r\n  }, {\r\n    name: \"private\",\r\n    route: \"private\",\r\n    moduleId: \"./private\",\r\n    nav: this.securityContext.isUserInRole(\"canAccessPrivate\"),\r\n    title: \"Private area\"\r\n  }\r\n]);\r\n```\r\nWhen the user login successfully, the `navigation` array should be rebuilt; I tried with `router.refreshNavigaiton()` but then I checked the source and got it's not its purpose.\r\nHow can I efficiently rebuild the `navigation` array of the routers in the router hierarchy?"},"comment":{"url":"https://api.github.com/repos/aurelia/router/issues/comments/142581864","html_url":"https://github.com/aurelia/router/issues/216#issuecomment-142581864","issue_url":"https://api.github.com/repos/aurelia/router/issues/216","id":142581864,"user":{"login":"EisenbergEffect","id":131485,"avatar_url":"https://avatars.githubusercontent.com/u/131485?v=3","gravatar_id":"","url":"https://api.github.com/users/EisenbergEffect","html_url":"https://github.com/EisenbergEffect","followers_url":"https://api.github.com/users/EisenbergEffect/followers","following_url":"https://api.github.com/users/EisenbergEffect/following{/other_user}","gists_url":"https://api.github.com/users/EisenbergEffect/gists{/gist_id}","starred_url":"https://api.github.com/users/EisenbergEffect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EisenbergEffect/subscriptions","organizations_url":"https://api.github.com/users/EisenbergEffect/orgs","repos_url":"https://api.github.com/users/EisenbergEffect/repos","events_url":"https://api.github.com/users/EisenbergEffect/events{/privacy}","received_events_url":"https://api.github.com/users/EisenbergEffect/received_events","type":"User","site_admin":false},"created_at":"2015-09-23T12:17:07Z","updated_at":"2015-09-23T12:17:07Z","body":"Is the `nav` property the only property you need to udpate?"}}