Project

General

Profile

« Previous | Next » 

Revision 52780

added authorization check to some post methods

View differences:

sr-journal.component.ts
13 13
} from "../../../shared/reusablecomponents/help-content.component";
14 14
import {RepositoryService} from "../../../services/repository.service";
15 15
import {ConfirmationDialogComponent} from "../../../shared/reusablecomponents/confirmation-dialog.component";
16
import {AuthenticationService} from "../../../services/authentication.service";
16 17

  
17 18
@Component ({
18 19
  selector: 'app-sr-journal',
......
60 61
    private fb: FormBuilder,
61 62
    private route: ActivatedRoute,
62 63
    private router: Router,
63
    private repoService: RepositoryService) {}
64
    private repoService: RepositoryService,
65
    private authService: AuthenticationService) {}
64 66

  
65 67
  ngOnInit() {
66 68
    this.setQueryParam('basicInformation');
......
125 127
      this.errorMessage = '';
126 128
      this.repoService.addRepository(this.repo.datasourceType, this.repo).subscribe(
127 129
        response => {
128
          console.log(`addRepository responded:\n${JSON.stringify(response)}`);
130
          console.log(`addRepository responded: ${response.id}, ${response.registeredBy}`);
129 131
          this.repo = response;
130 132
        },
131 133
        error => {
......
145 147
      let failed: boolean = false;
146 148
      for (let intrf of this.repoInterfaces) {
147 149
        if (intrf.id) {
148
          this.repoService.updateInterface(this.repo.id, intrf).subscribe(
150
          this.repoService.updateInterface(this.repo.id, this.repo.registeredBy, intrf).subscribe(
149 151
            response => {
150 152
              console.log(`updateInterface responded ${JSON.stringify(response)}`);
151 153
              intrf = response;
......
156 158
            }
157 159
          );
158 160
        } else {
159
          this.repoService.addInterface(this.repo.datasourceType, this.repo.id, intrf).subscribe (
161
          this.repoService.addInterface(this.repo.datasourceType, this.repo.id, this.repo.registeredBy, intrf).subscribe (
160 162
            addedInterface => {
161 163
              console.log(`addInterface responded ${JSON.stringify(addedInterface)}`);
162 164
              intrf = addedInterface;

Also available in: Unified diff