@@ -2,18 +2,15 @@ import { Injectable } from '@angular/core';
22import { ActivatedRouteSnapshot , CanActivate , Router , RouterStateSnapshot , UrlTree } from '@angular/router' ;
33
44import { Observable } from 'rxjs' ;
5- import { flatMap , take } from 'rxjs/operators' ;
5+ import { mergeMap } from 'rxjs/operators' ;
66
77import { CollectionDataService } from '../core/data/collection-data.service' ;
88import { AuthorizationDataService } from '../core/data/feature-authorization/authorization-data.service' ;
99import { FeatureID } from '../core/data/feature-authorization/feature-id' ;
1010import { Collection } from '../core/shared/collection.model' ;
11- import {
12- getFirstCompletedRemoteData ,
13- redirectOn4xx ,
14- returnForbiddenUrlTreeOrLoginOnFalse
15- } from '../core/shared/operators' ;
11+ import { getFirstCompletedRemoteData , } from '../core/shared/operators' ;
1612import { AuthService } from '../core/auth/auth.service' ;
13+ import { redirectOn4xx , returnForbiddenUrlTreeOrLoginOnFalse } from '../core/shared/authorized.operators' ;
1714
1815/**
1916 * A guard taking care of the correct route.data being set for the BulkImport components
@@ -33,7 +30,7 @@ export class BulkImportGuard implements CanActivate {
3330 return this . collectionService . findById ( route . params . id ) . pipe (
3431 getFirstCompletedRemoteData ( ) ,
3532 redirectOn4xx ( this . router , this . authService ) ,
36- flatMap ( ( RD ) => this . isCollectionAdmin ( RD . payload ) ) ,
33+ mergeMap ( ( RD ) => this . isCollectionAdmin ( RD . payload ) ) ,
3734 returnForbiddenUrlTreeOrLoginOnFalse ( this . router , this . authService , state . url )
3835 ) ;
3936 }
0 commit comments