Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
Move whitelisted routes into an array
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasolson committed Dec 2, 2014
1 parent c668e88 commit 6a3015e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/kibana/utils/routes/_setup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
define(function (require) {
return function routeSetup(Promise, kbnSetup, config, $route, kbnUrl, courier, Notifier, Private, $rootScope) {
var _ = require('lodash');
var errors = require('errors');
var NoDefaultIndexPattern = errors.NoDefaultIndexPattern;
var NoDefinedIndexPatterns = errors.NoDefinedIndexPatterns;
Expand All @@ -17,7 +18,13 @@ define(function (require) {
])
.then(function () {
var path = $route.current.$$route.originalPath;
if (!path.match(/settings\/indices/) && !path.match(/settings\/about/)) {
var allowedRoutes = [
'settings/indices',
'settings/about'
];
if (!_.find(allowedRoutes, function (route) {
return path.indexOf(route) >= 0;
})) {
return courier.indexPatterns.getIds()
.then(function (patterns) {
if (!config.get('defaultIndex')) {
Expand Down

0 comments on commit 6a3015e

Please sign in to comment.