[ACS-9768] remove deprecated methods from auth related components (#4688)

* [ACS-9768] remove deprecated methods from auth related components [link-adf:ACS-9768-Remove-deprecated-methods-from-auth-related-components]

* [ACS-9786] replace deprecated methods
This commit is contained in:
Grzegorz Jaśkowski
2025-08-28 20:35:21 +02:00
committed by GitHub
parent 9634b60aaa
commit 887455a0ef
4 changed files with 4 additions and 8 deletions

View File

@@ -54,7 +54,7 @@ export class AboutComponent implements OnInit {
landingPage = this.appSettings.landingPage;
ngOnInit(): void {
if (this.authService.isEcmLoggedIn()) {
if (this.authService.isLoggedIn()) {
this.setECMInfo();
}
}

View File

@@ -46,7 +46,7 @@ describe('AosEditOnlineService', () => {
authenticationService = TestBed.inject(AuthenticationService);
appConfigService = TestBed.inject(AppConfigService);
spyOn(authenticationService, 'getEcmUsername').and.returnValue('user1');
spyOn(authenticationService, 'getUsername').and.returnValue('user1');
spyOn(appConfigService, 'get').and.returnValue('http://localhost:3000');
userAgent = spyOnProperty(navigator, 'userAgent').and.returnValue('mac');
});

View File

@@ -51,7 +51,7 @@ export class AosEditOnlineService implements IAosEditOnlineService {
// );
const checkedOut = node.properties['cm:lockType'] === 'WRITE_LOCK' || node.properties['cm:lockType'] === 'READ_ONLY_LOCK';
const lockOwner = node.properties['cm:lockOwner'];
const differentLockOwner = lockOwner.id !== this.authenticationService.getEcmUsername();
const differentLockOwner = lockOwner.id !== this.authenticationService.getUsername();
if (checkedOut && differentLockOwner) {
this.onAlreadyLockedNotification(node.id, lockOwner.id);

View File

@@ -29,9 +29,5 @@ import { AuthenticationService } from '@alfresco/adf-core';
export const ViewProfileRuleGuard: CanActivateFn = () => {
const authService = inject(AuthenticationService);
const isEcmLoggedIn = (): boolean => {
return authService.isEcmLoggedIn() || (authService.isECMProvider() && authService.isKerberosEnabled());
};
return isEcmLoggedIn() || authService.isOauth();
return authService.isLoggedIn() || authService.isOauth();
};