mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Added tests for user-info component
This commit is contained in:
@@ -37,7 +37,7 @@ export class EcmUserService {
|
||||
* @param userName - the user name
|
||||
*/
|
||||
getUserInfo(userName: string): Observable<EcmUserModel> {
|
||||
if ( this.authService.getAlfrescoApi().ecmAuth.isLoggedIn() ) {
|
||||
if ( this.authService.isEcmLoggedIn() ) {
|
||||
return Observable.fromPromise(this.callApiGetPersonInfo(userName))
|
||||
.map(
|
||||
(data) => <EcmUserModel> data['entry']
|
||||
@@ -46,6 +46,10 @@ export class EcmUserService {
|
||||
}
|
||||
}
|
||||
|
||||
getCurrentUserInfo() {
|
||||
return this.getUserInfo('-me-');
|
||||
}
|
||||
|
||||
private callApiGetPersonInfo(userName: string, opts?: any) {
|
||||
return this.authService.getAlfrescoApi().core.peopleApi.getPerson(userName, opts);
|
||||
}
|
||||
|
Reference in New Issue
Block a user