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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user