Admin course and student management pages don't work for admins
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, python
- Ambito
- backend-api-design, full-stack
Direzione di ricerca
Start with pages/admin/courses/manage.js and pages/admin/students/manage.js, then trace the backend routes those pages call, including require_course_role and get_user_enrollments. Compare the proposed admin-only endpoints with the existing course-role checks; the issue notes that option 2 keeps those checks simple. Done means admins can manage courses and view the selected student's enrollments without granting access to non-admins.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The admin pages for managing a course and viewing a student call routes that only allow people enrolled in that course, or that ignore the parameter the page sends. An admin who isn't enrolled in the course gets 403s or the wrong data. This is separate from the auth fix in #366, which made the admin pages send the session cookie but didn't change these routes.
pages/admin/courses/manage.js:
get_course_info: requires student, TA or instructor in the course.get_course_enrollment: requires instructor or TA in the course.update_course: requires instructor in the course.delete_course: requires instructor in the course.create_enrollment: requires a staff role in the course.leave_course: has no auth at all (see the other issue).
pages/admin/students/manage.js:
- Calls
get_user_enrollments?user_id=<student>, but the backend ignoresuser_idand returns the logged-in user's own enrollments. The page shows the admin's courses, not the student's.
Options:
- Let a global admin pass these course checks, either inside
require_course_roleor with separate admin endpoints. - Add admin-only endpoints for the admin panel (for example, a user's enrollments by id) and point the admin pages at them.
Option 2 keeps the course role checks simple and makes admin access explicit.
- Lingua principale
- Python
- Stelle
- 13
- Fork
- 0
- Merge medio
- 2h 4m
- PR unite (30g)
- 1
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di kiat/codeAssist
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
kiat/codeAssist#391 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
kiat/codeAssist#364 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
kiat/codeAssist#393 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 63/100
kiat/codeAssist#392 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
kiat/codeAssist#390 ·
Tutte le issue di kiat/codeAssist
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
aws-samples/sample-per-model-bedrock#243 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
FuRongJun-1999/dsh-memory#404 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
bug frontend
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
PennyLaneAI/catalyst#3337 ·
I maintainer di solito rispondono entro 1 giorno
-
Workflow.schedule stops when a cron deadline passes before sleepForse già presa @HuaTNA l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno