From d33066ad0353c7d0710cbbfd14a792bdb30807de Mon Sep 17 00:00:00 2001 From: Miko Keskimaki Date: Wed, 31 Jan 2024 08:12:13 +0200 Subject: [PATCH] Fix teacher navbar links not being visible to admins --- src/server/services/users/preferences.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/services/users/preferences.js b/src/server/services/users/preferences.js index 236bcf8e6..3c2343a5c 100644 --- a/src/server/services/users/preferences.js +++ b/src/server/services/users/preferences.js @@ -106,8 +106,8 @@ const getPreferredTab = (user, fbts, hasSummaryAccess) => { */ const getUserPreferences = async user => { const teachedFbts = await getTeachedFeedbackTargets(user) - const hasSummaryAccess = teachedFbts.length > 0 - const hasCourseAccess = teachedFbts.length > 0 + const hasSummaryAccess = teachedFbts.length > 0 || user.isAdmin + const hasCourseAccess = teachedFbts.length > 0 || user.isAdmin const preferredTab = getPreferredTab(user, teachedFbts, hasSummaryAccess) const summaryView = hasSummaryAccess ? await getPreferredSummaryView(user) : null