mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Fetch the userInfo once loggedIn and expose the capability of admin (#7682)
* Fetch the userInfo once loggedIn and expose the cabilibility of admin * Rollback method * Return same use if defined * Use the same pepleContent service for UserInfoCOmpnent * Remove useless import * Use interface * Use angular resolver instead of guard * Remove fdescribe * Fix linting * Regenerate doc * Improve doc * Fix optional * Fix the unit test * Fix comment * Fix lint * Fix unit * Add fetch user as part of the ssoGuard * Fix unit test after fetch * Add additional unit * Fix await
This commit is contained in:
@@ -21,10 +21,10 @@ import { BpmUserModel } from '../../models/bpm-user.model';
|
||||
import { EcmUserModel } from '../../models/ecm-user.model';
|
||||
import { IdentityUserModel } from '../../models/identity-user.model';
|
||||
import { BpmUserService } from '../../services/bpm-user.service';
|
||||
import { EcmUserService } from '../../services/ecm-user.service';
|
||||
import { IdentityUserService } from '../../services/identity-user.service';
|
||||
import { of, Observable, Subject } from 'rxjs';
|
||||
import { MatMenuTrigger, MenuPositionX, MenuPositionY } from '@angular/material/menu';
|
||||
import { PeopleContentService } from '../../services/people-content.service';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-userinfo',
|
||||
@@ -70,7 +70,7 @@ export class UserInfoComponent implements OnInit, OnDestroy {
|
||||
selectedIndex: number;
|
||||
private destroy$ = new Subject();
|
||||
|
||||
constructor(private ecmUserService: EcmUserService,
|
||||
constructor(private peopleContentService: PeopleContentService,
|
||||
private bpmUserService: BpmUserService,
|
||||
private identityUserService: IdentityUserService,
|
||||
private authService: AuthenticationService) {
|
||||
@@ -125,7 +125,7 @@ export class UserInfoComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
private loadEcmUserInfo(): void {
|
||||
this.ecmUser$ = this.ecmUserService.getCurrentUserInfo();
|
||||
this.ecmUser$ = this.peopleContentService.getCurrentUserInfo();
|
||||
}
|
||||
|
||||
private loadBpmUserInfo() {
|
||||
@@ -153,7 +153,7 @@ export class UserInfoComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
getEcmAvatar(avatarId: any): string {
|
||||
return this.ecmUserService.getUserProfileImage(avatarId);
|
||||
return this.peopleContentService.getUserProfileImage(avatarId);
|
||||
}
|
||||
|
||||
getBpmUserImage(): string {
|
||||
|
Reference in New Issue
Block a user