import { bind , BindingScope , Provider } from '@loopback/core' ; import { IAuthUserWithPermissions } from '@sourceloop/core' ; import { Config } from 'loopback4-notifications' ; import { IChannelManager } from '../../types' ; @ bind ( { scope : BindingScope . TRANSIENT } ) export class ChannelManagerMockProvider implements Provider < IChannelManager > { value ( ) { return { isChannelAccessAllowed : ( user , config ) => { if ( config . receiver . to . map ( t => t . id ) . includes ( 'allowedChannel' ) ) { return true ; } else { return false ; } } , } ; } }