From b1954abc23aa6a2d94dd945cb501afc3dacc6d7b Mon Sep 17 00:00:00 2001 From: Christopher Hines Date: Tue, 20 Aug 2013 10:42:07 -0400 Subject: [PATCH] Fixed #415 Non-Admin profile can access Dashboard In site.js, in pagebeforeshow, added logic for when the current user is not an administrator, if the page is the dashboard, to redirect to index.html --- dashboard-ui/scripts/site.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 3e0c2e0e95..1d7541ac7c 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1120,6 +1120,7 @@ Dashboard.jQueryMobileInit(); $(document).on('pagebeforeshow', ".page", function () { var page = $(this); + var pageId = this.id; var userId = Dashboard.getCurrentUserId(); ApiClient.currentUserId(userId); @@ -1143,6 +1144,8 @@ $(document).on('pagebeforeshow', ".page", function () { if (user.Configuration.IsAdministrator) { Dashboard.ensureToolsMenu(page); + } else if (pageId == "dashboardPage") { + window.location.replace("index.html"); } Dashboard.ensureHeader(page, user);