[AAE-8155] Fix typo in providers (#7669)

This commit is contained in:
Pablo Martinez Garcia
2022-06-09 11:01:42 +02:00
committed by GitHub
parent 4d1c729620
commit 34e8832bae
2 changed files with 3 additions and 3 deletions

View File

@@ -47,7 +47,7 @@ describe('Auth Guard SSO role service', () => {
beforeEach(() => { beforeEach(() => {
appConfig = TestBed.inject(AppConfigService); appConfig = TestBed.inject(AppConfigService);
appConfig.config.provider = 'ECM'; appConfig.config.providers = 'ECM';
localStorage.clear(); localStorage.clear();
authGuard = TestBed.inject(AuthGuardSsoRoleService); authGuard = TestBed.inject(AuthGuardSsoRoleService);
jwtHelperService = TestBed.inject(JwtHelperService); jwtHelperService = TestBed.inject(JwtHelperService);
@@ -222,7 +222,7 @@ describe('Auth Guard SSO role service', () => {
it('Should not retrieve the user when the provider is BPM', async () => { it('Should not retrieve the user when the provider is BPM', async () => {
spyUserAccess([], {}); spyUserAccess([], {});
spyOn(peopleContentService, 'getCurrentPerson'); spyOn(peopleContentService, 'getCurrentPerson');
appConfig.config.provider = 'BPM'; appConfig.config.providers = 'BPM';
const router: ActivatedRouteSnapshot = new ActivatedRouteSnapshot(); const router: ActivatedRouteSnapshot = new ActivatedRouteSnapshot();
router.data = { roles: ['ALFRESCO_ADMINISTRATORS'] }; router.data = { roles: ['ALFRESCO_ADMINISTRATORS'] };

View File

@@ -74,7 +74,7 @@ export class AuthGuardSsoRoleService implements CanActivate {
} }
private checkContentAdministratorRole(rolesToCheck: string[], excludedRoles: string[]): boolean { private checkContentAdministratorRole(rolesToCheck: string[], excludedRoles: string[]): boolean {
const hasContentProvider = this.appConfig.config.provider === 'ECM' || this.appConfig.config.provider === 'ALL'; const hasContentProvider = this.appConfig.config.providers === 'ECM' || this.appConfig.config.providers === 'ALL';
const checkAdminRole = rolesToCheck.includes(ContentGroups.ALFRESCO_ADMINISTRATORS) || excludedRoles.includes(ContentGroups.ALFRESCO_ADMINISTRATORS); const checkAdminRole = rolesToCheck.includes(ContentGroups.ALFRESCO_ADMINISTRATORS) || excludedRoles.includes(ContentGroups.ALFRESCO_ADMINISTRATORS);
return hasContentProvider && checkAdminRole; return hasContentProvider && checkAdminRole;
} }