mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Added new version for component
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoAuthenticationService, AlfrescoSettingsService } from 'ng2-alfresco-core';
|
||||
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Response } from '@angular/http';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
@@ -29,12 +29,11 @@ import { BpmUserModel } from '../models/bpm-user.model';
|
||||
@Injectable()
|
||||
export class BpmUserService {
|
||||
|
||||
constructor(private authService: AlfrescoAuthenticationService,
|
||||
private settingService: AlfrescoSettingsService) {
|
||||
constructor(private authService: AlfrescoAuthenticationService) {
|
||||
}
|
||||
|
||||
/**
|
||||
* get User Information via ECM
|
||||
* get Current User information for BPM
|
||||
* @param userName - the user name
|
||||
*/
|
||||
getCurrentUserInfo(): Observable<BpmUserModel> {
|
||||
@@ -47,19 +46,31 @@ export class BpmUserService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get User Information via ECM
|
||||
* @param userName - the user name
|
||||
*/
|
||||
getCurrentUserProfileImage(): string {
|
||||
getCurrentUserProfileImage(): any {
|
||||
if ( this.authService.getAlfrescoApi().bpmAuth.isLoggedIn() ) {
|
||||
return this.settingService.getBPMApiBaseUrl() + '/api/enterprise/profile-picture';
|
||||
return Observable.fromPromise(this.callApiGetProfilePicture())
|
||||
.map(
|
||||
(data) => data
|
||||
)
|
||||
.catch(this.handleError);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Call js api to get current user profile picture
|
||||
*/
|
||||
private callApiGetProfilePicture() {
|
||||
return this.authService.getAlfrescoApi().activiti.profileApi.getProfile();
|
||||
}
|
||||
|
||||
/**
|
||||
* Call js api to get current user information
|
||||
*/
|
||||
private callApiGetProfile() {
|
||||
return this.authService.getAlfrescoApi().activiti.profileApi.getProfile();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Throw the error
|
||||
* @param error
|
||||
|
Reference in New Issue
Block a user