Project

General

Profile

« Previous | Next » 

Revision 57073

[Admin]: Change check of user info from user management.

View differences:

entities.component.ts
9 9
import {Session} from '../../openaireLibrary/login/utils/helper.class';
10 10
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
11 11
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
12
import {UserManagementService} from '../../openaireLibrary/services/user-management.service';
12 13

  
13 14
@Component({
14 15
    selector: 'entities',
......
55 56
    public modalErrorMessage = '';
56 57
    public isPortalAdministrator = null;
57 58

  
59
  constructor(private element: ElementRef, private route: ActivatedRoute,
60
              private _router: Router,
61
              private _helpContentService: HelpContentService,
62
              private userManagementService: UserManagementService) {}
63

  
58 64
    ngOnInit() {
59 65
      this.formGroup = this.formComponent.form;
60 66
      this.route.data
......
63 69

  
64 70
           this.route.queryParams.subscribe(params => {
65 71
             HelperFunctions.scroll();
66

  
67
             this.selectedCommunityPid = params['communityId'];
68
             this.applyCommunityFilter(this.selectedCommunityPid);
69
             this.isPortalAdministrator = Session.isPortalAdministrator() && !this.selectedCommunityPid;
72
            this.userManagementService.getUserInfo(this.properties.userInfoUrl).subscribe( user => {
73
              this.selectedCommunityPid = params['communityId'];
74
              this.applyCommunityFilter(this.selectedCommunityPid);
75
              this.isPortalAdministrator = Session.isPortalAdministrator(user) && !this.selectedCommunityPid;
76
            });
70 77
           });
71 78
      });
72 79

  
73 80
    }
74 81

  
75
    constructor(private element: ElementRef, private route: ActivatedRoute,
76
                private _router: Router,
77
                private _helpContentService: HelpContentService) {}
78 82
    getEntities(community_pid: string) {
79 83
      if (!Session.isLoggedIn()) {
80 84
        this._router.navigate(['/user-info'],

Also available in: Unified diff