RED-8354: fixed rerouting for application admins.

This commit is contained in:
Nicoleta Panaghiu 2024-01-30 14:50:54 +02:00
parent d1d5019cc2
commit 60c7793082

View File

@ -23,7 +23,7 @@ async function redirectToLastDossierTemplate(router: Router, state: RouterStateS
}
export function mainGuard(): AsyncGuard {
return async (route, state) => {
return async (_, state) => {
const logger = inject(NGXLogger);
logger.info('[ROUTES] Main resolver started...');
@ -45,7 +45,7 @@ export function mainGuard(): AsyncGuard {
const generalConfig$ = inject(GeneralSettingsService).getGeneralConfigurations();
const updatedDisplayName$ = generalConfig$.pipe(tap(config => configService.updateDisplayName(config.displayName)));
const currentUser = getCurrentUser();
const isUsersAdminOnly = currentUser.isUserAdmin && currentUser.roles.length === 1;
const isUsersAdminOnly = currentUser.isUserAdmin && !currentUser.isUser && !currentUser.isManager;
await Promise.all([
systemPreferencesService.loadPreferencesIfNeeded(),