From db6e3d5aab9c41fc69122e7c85182b819755cd63 Mon Sep 17 00:00:00 2001 From: Joze RIHTARSIC <joze.RIHTARSIC@ext.ec.europa.eu> Date: Wed, 28 Sep 2022 14:12:09 +0200 Subject: [PATCH] UI: add action to open SSO data from "sandwich menu" --- smp-angular/src/app/app.component.html | 5 +++-- smp-angular/src/app/app.component.ts | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/smp-angular/src/app/app.component.html b/smp-angular/src/app/app.component.html index 6430c8398..9f937de93 100644 --- a/smp-angular/src/app/app.component.html +++ b/smp-angular/src/app/app.component.html @@ -95,12 +95,13 @@ <button *ngIf="isUserAuthPasswdEnabled" mat-menu-item id="changePassword_id" (click)="changeCurrentUserPassword()"> <span>Change password</span> </button> + <button *ngIf="isUserAuthSSOEnabled" mat-menu-item id="showSSODetails_id" (click)="openCurrentCasUserData()"> + <span>Open CAS user data</span> + </button> <button *ngIf="isWebServiceUserTokenAuthPasswdEnabled" mat-menu-item id="getAccessToken_id" (click)="regenerateCurrentUserAccessToken()"> <span>Generated access token</span> </button> - <hr/> - <button mat-menu-item (click)="logout($event)" id="logout_id"> <mat-icon>power_settings_new</mat-icon> <span>Logout</span> diff --git a/smp-angular/src/app/app.component.ts b/smp-angular/src/app/app.component.ts index f212b3e8e..da611b1b9 100644 --- a/smp-angular/src/app/app.component.ts +++ b/smp-angular/src/app/app.component.ts @@ -34,6 +34,10 @@ export class AppComponent { this.userController = new UserController(this.http, this.lookups, this.dialog); } + openCurrentCasUserData() { + window.open(this.securityService.getCurrentUser().casUserDataUrl, "_blank"); + } + get isWebServiceUserTokenAuthPasswdEnabled(): boolean { return this.lookups.cachedApplicationConfig?.webServiceAuthTypes?.includes('TOKEN'); } @@ -42,6 +46,10 @@ export class AppComponent { return this.lookups.cachedApplicationInfo?.authTypes.includes('PASSWORD'); } + get isUserAuthSSOEnabled(): boolean { + return this.lookups.cachedApplicationInfo?.authTypes?.includes('SSO'); + } + isCurrentUserSystemAdmin(): boolean { return this.securityService.isCurrentUserInRole([Authority.SYSTEM_ADMIN]); } -- GitLab