Revision 60248
Added by Konstantinos Triantafyllou over 3 years ago
role-users.component.ts | ||
---|---|---|
5 | 5 |
import {UserRegistryService} from "../../../services/user-registry.service"; |
6 | 6 |
import {EnvProperties} from "../../../utils/properties/env-properties"; |
7 | 7 |
import {properties} from "../../../../../environments/environment"; |
8 |
import {Session} from "../../../login/utils/helper.class"; |
|
8 |
import {Session, User} from "../../../login/utils/helper.class";
|
|
9 | 9 |
import {UserManagementService} from "../../../services/user-management.service"; |
10 | 10 |
import {Router} from "@angular/router"; |
11 | 11 |
import {LoginErrorCodes} from "../../../login/utils/guardHelper.class"; |
... | ... | |
29 | 29 |
@Input() |
30 | 30 |
public link: string; |
31 | 31 |
@Input() |
32 |
public isPortalAdmin: boolean = false; |
|
33 |
@Input() |
|
34 | 32 |
public role: "member" | "manager" = "manager"; |
35 | 33 |
@Input() |
36 |
public messages: Map<"member" | "manager", string> = null; |
|
34 |
public message: string = null; |
|
35 |
public user: User = null; |
|
37 | 36 |
public active: any[]; |
38 | 37 |
public pending: any[]; |
39 | 38 |
public showActive: boolean = true; |
... | ... | |
59 | 58 |
ngOnInit() { |
60 | 59 |
this.updateLists(); |
61 | 60 |
this.userManagementService.getUserInfo().subscribe(user => { |
62 |
if(user) { |
|
63 |
if(!Session.isPortalAdministrator(user) && !Session.isCurator(this.type, user) && !Session.isManager(this.type, this.id, user)) { |
|
64 |
this.router.navigate(['/user-info'], { |
|
65 |
queryParams: { |
|
66 |
"errorCode": LoginErrorCodes.NOT_AUTHORIZED, |
|
67 |
"redirectUrl": this.router.url |
|
68 |
} |
|
69 |
}); |
|
70 |
} |
|
71 |
} |
|
61 |
this.user = user; |
|
72 | 62 |
}); |
73 | 63 |
} |
74 | 64 |
|
... | ... | |
232 | 222 |
this.loadPending = false; |
233 | 223 |
}); |
234 | 224 |
} |
225 |
|
|
226 |
public get isPortalAdmin() { |
|
227 |
return Session.isPortalAdministrator(this.user) || Session.isCurator(this.type, this.user); |
|
228 |
} |
|
235 | 229 |
} |
Also available in: Unified diff
[Library | Trunk]: Remove dashboards-users component