fix(#4906): 🐛 Fixed an issue with power users and permissions

pull/4907/head
tidusjar 2 years ago
parent 0069bfdf54
commit 80884bcd72

@ -18,7 +18,7 @@ export class RadarrSettingsState {
@Action(LoadSettings) @Action(LoadSettings)
public load({ setState }: StateContext<RadarrState>): Observable<RadarrState> { public load({ setState }: StateContext<RadarrState>): Observable<RadarrState> {
const isAdmin = this.authService.isAdmin(); const isAdmin = this.authService.hasRole("Admin");
const calls = isAdmin ? [this.settingsService.getRadarr()] : [of({})]; const calls = isAdmin ? [this.settingsService.getRadarr()] : [of({})];
return combineLatest(calls).pipe( return combineLatest(calls).pipe(

@ -18,7 +18,7 @@ export class SonarrSettingsState {
@Action(LoadSettings) @Action(LoadSettings)
public load({ setState }: StateContext<SonarrState>): Observable<SonarrState> { public load({ setState }: StateContext<SonarrState>): Observable<SonarrState> {
const isAdmin = this.authService.isAdmin(); const isAdmin = this.authService.hasRole("Admin");
const calls = isAdmin ? [this.sonarrService.getVersion(), this.settingsService.getSonarr()] : [of(""), of({})]; const calls = isAdmin ? [this.sonarrService.getVersion(), this.settingsService.getSonarr()] : [of(""), of({})];
return combineLatest(calls).pipe( return combineLatest(calls).pipe(

Loading…
Cancel
Save