File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/Web/Server/routes/authenticated/user Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,10 @@ const status = () => {
4141 if ( req . serverBot !== undefined ) {
4242 bots = [ req . serverBot ] ;
4343 } else {
44- bots = ( req . user as Express . User ) . isOperator ? req . botApp . bots : req . botApp . bots . filter ( x => intersect ( req . user ?. subreddits as string [ ] , x . subManagers . map ( y => y . subreddit . display_name ) ) ) ;
44+ bots = ( req . user as Express . User ) . isOperator ? req . botApp . bots : req . botApp . bots . filter ( x => {
45+ const i = intersect ( req . user ?. subreddits as string [ ] , x . subManagers . map ( y => y . subreddit . display_name ) ) ;
46+ return i . length > 0 ;
47+ } ) ;
4548 }
4649 const botResponses : BotStatusResponse [ ] = [ ] ;
4750 for ( const b of bots ) {
@@ -89,6 +92,9 @@ const status = () => {
8992 if ( m === undefined ) {
9093 continue ;
9194 }
95+ if ( ! ( req . user as Express . User ) . isOperator && ! ( req . user ?. subreddits as string [ ] ) . includes ( m . subreddit . display_name ) ) {
96+ continue ;
97+ }
9298 const sd = {
9399 name : s ,
94100 //linkName: s.replace(/\W/g, ''),
You can’t perform that action at this time.
0 commit comments