[AAE-7077] Reset people content service cache on logout (#7637)

* reset people content state on logout

* unit test

* use property accessor
This commit is contained in:
Denys Vuika
2022-05-16 20:14:00 +01:00
committed by GitHub
parent 2107538c51
commit 1e3099b99b
2 changed files with 62 additions and 38 deletions

View File

@@ -22,6 +22,7 @@ import { catchError, map } from 'rxjs/operators';
import { PersonEntry, PeopleApi, PersonBodyCreate, Pagination, PersonBodyUpdate } from '@alfresco/js-api';
import { EcmUserModel } from '../models/ecm-user.model';
import { LogService } from './log.service';
import { AuthenticationService } from './authentication.service';
// eslint-disable-next-line no-shadow
export enum ContentGroups {
@@ -57,7 +58,15 @@ export class PeopleContentService {
return this._peopleApi;
}
constructor(private apiService: AlfrescoApiService, private logService: LogService) {
constructor(
private apiService: AlfrescoApiService,
authenticationService: AuthenticationService,
private logService: LogService
) {
authenticationService.onLogout.subscribe(() => {
this.hasCheckedIsContentAdmin = false;
this.hasContentAdminRole = false;
});
}
/**