initialize: function (/*options*/) { this._userInfo = App.settings.userInfo || {}; this._headerView = new HeaderView({ userInfo: this._userInfo }); App.headerRegion.show(this._headerView); // Event subscriptions // Prevent UI shifting on paging operations App.Notifications.on('Paginator.onPrePage', this._onPrePage, this); App.Notifications.on('Paginator.onDonePage', this._onDonePage, this); App.Notifications.on('Logout', this._onLogout, this); },
initialize: function (/*options*/) { this._userInfo = App.settings.userInfo || {}; if (!this._userInfo.isLoggedIn) { window.location.replace('/login'); } this._isAdmin = false; if (_.isArray(this._userInfo.roles)) { if (_.indexOf(this._userInfo.roles, 'super-admin') >= 0) { this._isAdmin = true; } else { window.location.replace('/login'); } } this._headerView = new HeaderView({ userInfo: this._userInfo }); App.headerRegion.show(this._headerView); // Event subscriptions // Prevent UI shifting on paging operations App.Notifications.on('Paginator.onPrePage', this._onPrePage, this); App.Notifications.on('Paginator.onDonePage', this._onDonePage, this); App.Notifications.on('Logout', this._onLogout, this); },