import { AbstractRoleGuard } from './abstract-role.guard';
import { AppState } from 'src/app/store/app.reducers';
import { RoleUtil } from './../role.util';
import { Store } from '@ngrx/store';
import { HttpClient } from '@angular/common/http';
import { User } from '../model/user.model';
import { Router } from '@angular/router';
import { Injectable } from "@angular/core";

@Injectable()
export class AdminRoleGuard extends AbstractRoleGuard{
    
    constructor(store: Store<AppState>, http: HttpClient, router: Router, private roleUtil: RoleUtil) {
        super(store, http, router);
    }

    hasRights(roleNameOrUser: String | User): boolean{
        return this.roleUtil.hasAdminRights(roleNameOrUser);
    }
    
}