File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -313,17 +313,19 @@ const FEATURE_NAME = 'reports';
313313
314314 convertToTimezone ( props ) ;
315315
316- // TODO: Handle report type check
317- if ( props . apps && Array . isArray ( props . apps ) && props . apps . length > 0 ) {
318- const userApps = getUserApps ( params . member ) ;
319- let notPermitted = false ;
316+ if ( props . report_type === "core" ) {
317+ if ( ! props . apps || ! Array . isArray ( props . apps ) || props . apps . length === 0 ) {
318+ common . returnMessage ( params , 400 , 'Invalid or missing apps' ) ;
319+ return ;
320+ }
320321
322+ let userApps = getUserApps ( params . member ) ;
323+ let notPermitted = false ;
321324 for ( var i = 0 ; i < props . apps . length ; i ++ ) {
322325 if ( userApps . indexOf ( props . apps [ i ] ) === - 1 ) {
323326 notPermitted = true ;
324327 }
325328 }
326-
327329 if ( notPermitted && ! params . member . global_admin ) {
328330 return common . returnMessage ( params , 401 , 'User does not have right to access this information' ) ;
329331 }
You can’t perform that action at this time.
0 commit comments