diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2026-06-10 15:26:26 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2026-06-10 15:26:26 +0200 |
| commit | 5067aa19a28a32bab8d4489f9948fef9a58bbd68 (patch) | |
| tree | 7de56cae43036933fc3acb86e837ab72e8927ee1 /cockpit | |
| parent | 159b0fdc75dccecdf6b33b98a3eca6072ae33a83 (diff) | |
| download | bycs-sol-5067aa19a28a32bab8d4489f9948fef9a58bbd68.tar.gz bycs-sol-5067aa19a28a32bab8d4489f9948fef9a58bbd68.zip | |
cockpit: only fetch a student if the user is a teacher
Fetching a student needs access to the participants of the course,
which only teachers have.
Diffstat (limited to 'cockpit')
| -rw-r--r-- | cockpit/js/cockpit.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cockpit/js/cockpit.js b/cockpit/js/cockpit.js index c6524d6..2babcea 100644 --- a/cockpit/js/cockpit.js +++ b/cockpit/js/cockpit.js @@ -9,7 +9,7 @@ import { submitGraduationChange } from "./graduation-ENV.js"; -import { fetchStudent, fetchStudents } from "./student-ENV.js"; +import { Student, fetchStudent, fetchStudents } from "./student-ENV.js"; import { isTeacher as getIsTeacher } from "../../utils-ENV.js"; import { initSelection } from "./selection.js"; @@ -26,7 +26,11 @@ function initCurrentName() { } async function loadNewStudent(id, name, group) { - student = await fetchStudent(id, name, group); + if (isTeacher) { + student = await fetchStudent(id, name, group); + } else { + student = new Student(id, name, group); + } await loadStudent(student); } |
