Project

General

Profile

« Previous | Next » 

Revision 52836

added cookie-law banner - 403 authorization via ui and new usage-stats pages

View differences:

compatibility-monitor-repo.component.ts
1 1
import { Component, OnInit } from '@angular/core';
2
import { ActivatedRoute } from '@angular/router';
2
import {ActivatedRoute, Router} from '@angular/router';
3 3
import {AggregationDetails, Aggregations, Repository} from '../../domain/typeScriptClasses';
4 4
import { RepositoryService } from '../../services/repository.service';
5 5
import {
......
9 9
  loadingRepoMessage,
10 10
  noAggregationHistory
11 11
} from '../../domain/shared-messages';
12
import {AuthenticationService} from "../../services/authentication.service";
12 13

  
13 14
@Component ({
14 15
  selector: 'app-compatibility-monitor-repo',
......
27 28
  latestAggregations: AggregationDetails[] = [];
28 29

  
29 30
  constructor(private route: ActivatedRoute,
30
              private repoService: RepositoryService) {}
31
              private router: Router,
32
              private repoService: RepositoryService,
33
              private authService: AuthenticationService) {}
31 34

  
32 35
  ngOnInit() {
33 36
    this.readRepoId();
......
55 58
          this.loadingMessage = '';
56 59
          if (this.repo) {
57 60
            this.repoName = this.repo.officialName;
58
            this.getLatestAggregationHistory();
61
            if ( this.authService.getUserEmail() !== this.repo.registeredBy ) {
62
              this.router.navigateByUrl('/403-forbidden', { skipLocationChange: true });
63
            } else {
64
              this.getLatestAggregationHistory();
65
            }
59 66
          } else {
60 67
            this.errorMessage = loadingRepoError;
61 68
          }

Also available in: Unified diff