RED-3484 quick fix
This commit is contained in:
parent
050d270c2e
commit
559aaa96cf
@ -2,12 +2,23 @@ import { Injectable, Injector } from '@angular/core';
|
||||
import { StatsService } from '@iqser/common-ui';
|
||||
import { DossierStats, IDossierStats } from '@red/domain';
|
||||
import { DOSSIER_ID } from '@utils/constants';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { UserService } from '@services/user.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class DossierStatsService extends StatsService<DossierStats, IDossierStats> {
|
||||
constructor(protected readonly _injector: Injector) {
|
||||
constructor(protected readonly _injector: Injector, private readonly _userService: UserService) {
|
||||
super(_injector, DOSSIER_ID, DossierStats, 'dossier-stats');
|
||||
}
|
||||
|
||||
getFor(ids: string[]): Observable<DossierStats[]> {
|
||||
const isUserAdminOnly = this._userService.currentUser.roles.length === 1 && this._userService.currentUser.isUserAdmin;
|
||||
if (isUserAdminOnly) {
|
||||
return of([]);
|
||||
}
|
||||
|
||||
return super.getFor(ids);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user