Merge branch 'RED-8354' into 'master'

RED-8354: fixed rerouting for application admins.

See merge request redactmanager/red-ui!276
This commit is contained in:
Dan Percic 2024-01-30 13:52:26 +01:00
commit 7bf07bf690

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(),