<commit_before>import { Injectable } from '@angular/core';
import { KMCPermissions, KMCPermissionsService } from '../../kmc-permissions';
import { KalturaLogger } from '@kaltura-ng/kaltura-logger/kaltura-logger.service';
import { KmcMainViewBaseService } from '../kmc-main-view-base.service';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/fromPromise';
import { Router } from '@angular/router';
import {serverConfig} from 'config/server';
import { BrowserService } from 'app-shared/kmc-shell';

@Injectable()
export class UsageDashboardMainViewService extends KmcMainViewBaseService {

    constructor(
        logger: KalturaLogger,
        browserService: BrowserService,
        router: Router,
        private _appPermissions: KMCPermissionsService
    ) {
        super(logger.subLogger('UsageDashboardMainViewService'),  browserService, router);
    }

    isAvailable(): boolean {
        return serverConfig.externalApps.usageDashboard.enabled && this._appPermissions.hasAnyPermissions([
            KMCPermissions.FEATURE_ENABLE_USAGE_DASHBOARD,
            KMCPermissions.ANALYTICS_BASE
        ]);
    }

    getRoutePath(): string {
        return 'usageDashboard';
    }
}

<commit_msg>fix: fix usage dashboard permissions logic<commit_after>import { Injectable } from '@angular/core';
import { KMCPermissions, KMCPermissionsService } from '../../kmc-permissions';
import { KalturaLogger } from '@kaltura-ng/kaltura-logger/kaltura-logger.service';
import { KmcMainViewBaseService } from '../kmc-main-view-base.service';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/fromPromise';
import { Router } from '@angular/router';
import {serverConfig} from 'config/server';
import { BrowserService } from 'app-shared/kmc-shell';

@Injectable()
export class UsageDashboardMainViewService extends KmcMainViewBaseService {

    constructor(
        logger: KalturaLogger,
        browserService: BrowserService,
        router: Router,
        private _appPermissions: KMCPermissionsService
    ) {
        super(logger.subLogger('UsageDashboardMainViewService'),  browserService, router);
    }

    isAvailable(): boolean {
        return serverConfig.externalApps.usageDashboard.enabled &&
            this._appPermissions.hasPermission(KMCPermissions.FEATURE_ENABLE_USAGE_DASHBOARD) &&
            this._appPermissions.hasPermission(KMCPermissions.ANALYTICS_BASE);
    }

    getRoutePath(): string {
        return 'usageDashboard';
    }
}


{'fraction_non_alphanumeric': 0.10858283433133732, 'fraction_numerical': 0.0, 'mean_word_length': 4.022044088176353, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7062633', 'n_tokens_mistral': 734, 'n_tokens_neox': 733, 'n_words': 134}