File tree 2 files changed +4
-2
lines changed
frontend/public/javascripts
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -252,7 +252,7 @@ var common = require('../../../api/utils/common.js'),
252
252
//if app_id was provided, we need to check if user has access for this app_id
253
253
// is user_of array contain current app_id?
254
254
var isUserOf = params . member . user_of && params . member . user_of . indexOf ( params . qstring . app_id ) !== - 1 ;
255
- var isRestricted = params . member . app_restrict && params . member . app_restrict . hasOwnProperty ( params . qstring . app_id ) !== - 1 && params . member . app_restrict [ params . qstring . app_id ] . indexOf ( "#/manage/db" ) ;
255
+ var isRestricted = params . member . app_restrict && params . member . app_restrict [ params . qstring . app_id ] && params . member . app_restrict [ params . qstring . app_id ] . indexOf ( "#/manage/db" ) ;
256
256
if ( params . member . global_admin || isUserOf && ! isRestricted ) {
257
257
apps = [ params . qstring . app_id ] ;
258
258
}
Original file line number Diff line number Diff line change @@ -83,7 +83,9 @@ window.DBViewerView = countlyView.extend({
83
83
$ ( '#app-list' ) . prepend ( '<div data-value="all" class="app-option item" data-localize=""><span class="app-title-in-dropdown">' + $ . i18n . map [ "common.all" ] + '</span></div>' ) ;
84
84
// append list items
85
85
for ( var key in countlyGlobal . apps ) {
86
- $ ( '#app-list' ) . append ( '<div data-value="' + countlyGlobal . apps [ key ] . _id + '" class="app-option item" data-localize=""><span class="app-title-in-dropdown">' + countlyGlobal . apps [ key ] . name + '</span></div>' ) ;
86
+ if ( ! countlyGlobal . member . app_restrict || ( countlyGlobal . member . app_restrict && ! countlyGlobal . member . app_restrict . hasOwnProperty ( key ) ) ) {
87
+ $ ( '#app-list' ) . append ( '<div data-value="' + countlyGlobal . apps [ key ] . _id + '" class="app-option item" data-localize=""><span class="app-title-in-dropdown">' + countlyGlobal . apps [ key ] . name + '</span></div>' ) ;
88
+ }
87
89
}
88
90
// set height
89
91
if ( $ ( '#dbviewer' ) . height ( ) < ( window . innerHeight - 150 ) ) {
You can’t perform that action at this time.
0 commit comments