[ACS-8770] fix sonarcube issues

This commit is contained in:
Anton Ramanovich
2025-06-12 09:50:10 +02:00
parent 67b6a8d043
commit 5880905240
2 changed files with 12 additions and 15 deletions
@@ -1,6 +1,6 @@
/*! /*!
* @license * @license
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved. * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@ import { UserRepresentation } from '@alfresco/js-api';
@Component({ @Component({
selector: 'app-shell-user-info', selector: 'app-shell-user-info',
templateUrl: './user-info.component.html' template: ''
}) })
export class UserInfoComponent implements OnInit { export class UserInfoComponent implements OnInit {
/** Custom choice for opening the menu at the bottom. Can be `before` or `after`. */ /** Custom choice for opening the menu at the bottom. Can be `before` or `after`. */
@@ -43,11 +43,11 @@ export class UserInfoComponent implements OnInit {
userInfoMode = UserInfoMode; userInfoMode = UserInfoMode;
constructor( constructor(
private peopleContentService: PeopleContentService, private readonly peopleContentService: PeopleContentService,
private peopleProcessService: PeopleProcessService, private readonly peopleProcessService: PeopleProcessService,
private identityUserService: IdentityUserService, private readonly identityUserService: IdentityUserService,
private basicAlfrescoAuthService: BasicAlfrescoAuthService, private readonly basicAlfrescoAuthService: BasicAlfrescoAuthService,
private authService: AuthenticationService private readonly authService: AuthenticationService
) {} ) {}
ngOnInit() { ngOnInit() {
@@ -96,17 +96,14 @@ export class UserInfoComponent implements OnInit {
} }
private isAllLoggedIn() { private isAllLoggedIn() {
return ( return this.authService.isLoggedIn() || (this.authService.isALLProvider() && this.basicAlfrescoAuthService.isKerberosEnabled());
(this.authService.isEcmLoggedIn() && this.authService.isBpmLoggedIn()) ||
(this.authService.isALLProvider() && this.basicAlfrescoAuthService.isKerberosEnabled())
);
} }
private isBpmLoggedIn() { private isBpmLoggedIn() {
return this.authService.isBpmLoggedIn() || (this.authService.isECMProvider() && this.basicAlfrescoAuthService.isKerberosEnabled()); return this.authService.isLoggedIn() || (this.authService.isECMProvider() && this.basicAlfrescoAuthService.isKerberosEnabled());
} }
private isEcmLoggedIn() { private isEcmLoggedIn() {
return this.authService.isEcmLoggedIn() || (this.authService.isECMProvider() && this.basicAlfrescoAuthService.isKerberosEnabled()); return this.authService.isLoggedIn() || (this.authService.isECMProvider() && this.basicAlfrescoAuthService.isKerberosEnabled());
} }
} }
@@ -122,7 +122,7 @@ export class AuthenticationService implements AuthenticationServiceInterface, ee
*/ */
isEcmLoggedIn(): boolean { isEcmLoggedIn(): boolean {
if (this.isOauth()) { if (this.isOauth()) {
return this.oidcAuthenticationService.isEcmLoggedIn(); return this.oidcAuthenticationService.isLoggedIn();
} else { } else {
return this.basicAlfrescoAuthService.isEcmLoggedIn(); return this.basicAlfrescoAuthService.isEcmLoggedIn();
} }
@@ -134,7 +134,7 @@ export class AuthenticationService implements AuthenticationServiceInterface, ee
*/ */
isBpmLoggedIn(): boolean { isBpmLoggedIn(): boolean {
if (this.isOauth()) { if (this.isOauth()) {
return this.oidcAuthenticationService.isBpmLoggedIn(); return this.oidcAuthenticationService.isLoggedIn();
} else { } else {
return this.basicAlfrescoAuthService.isBpmLoggedIn(); return this.basicAlfrescoAuthService.isBpmLoggedIn();
} }