From 04e73511edcd769780227a19dda6d3d89572a3ce Mon Sep 17 00:00:00 2001
From: Ron Lucke <lucke@elan-ev.de>
Date: Thu, 7 Apr 2022 13:12:47 +0000
Subject: [PATCH] fix #786

---
 resources/vue/store/courseware/courseware.module.js | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/resources/vue/store/courseware/courseware.module.js b/resources/vue/store/courseware/courseware.module.js
index afd99c032cc..3e80e5c7477 100755
--- a/resources/vue/store/courseware/courseware.module.js
+++ b/resources/vue/store/courseware/courseware.module.js
@@ -1008,6 +1008,13 @@ export const actions = {
     },
 
     loadTeacherStatus({ dispatch, rootGetters, state, commit, getters }, userId) {
+        const user = rootGetters['users/byId']({ id: userId });
+
+        if (user.attributes.permission === 'root') {
+            commit('setUserIsTeacher', true);
+            return;
+        }
+
         const membershipId = `${state.context.id}_${userId}`;
 
         return dispatch('course-memberships/loadById', { id: membershipId })
-- 
GitLab