mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
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:
parent
3021d62eb4
commit
b1954abc23
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue