From 7947334e4819fd9b9c6387488efe3565857a33f6 Mon Sep 17 00:00:00 2001 From: "p.hollmann" <31701319+paulhollmann@users.noreply.github.com> Date: Tue, 21 May 2024 22:27:55 +0200 Subject: [PATCH] Update UserExtensions.ts --- backend/src/models/extensions/UserExtensions.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/src/models/extensions/UserExtensions.ts b/backend/src/models/extensions/UserExtensions.ts index 9ef5e69..5adb601 100644 --- a/backend/src/models/extensions/UserExtensions.ts +++ b/backend/src/models/extensions/UserExtensions.ts @@ -210,8 +210,7 @@ async function getCoursesWithInformation(this: User): Promise { * Checks if the user is a mentor (i.e. is a member of any mentor group) */ async function isMentor(this: User): Promise { - const mentorGroups = await this.getMentorGroups(); - return mentorGroups.length > 0; + return this.hasPermission('mentor.view'); } export default {