Admin course and student management pages don't work for admins
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- javascript, python
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Python
- 星标
- 13
- 派生
- 0
- 平均合并
- 2 小时 4 分钟
- 30 天内合并 PR
- 1
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
kiat/codeAssist 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
kiat/codeAssist#391 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
kiat/codeAssist#364 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 42/100
kiat/codeAssist#393 ·
-
难度 3/5 1-2 天 新手友好度 63/100
kiat/codeAssist#392 ·
-
难度 4/5 3-5 天 新手友好度 52/100
kiat/codeAssist#390 ·
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
Deltares/imod-python#1940 ·
维护者通常 1 天内回复
-
effort: low prio: low ready
难度 1/5 1 小时以内 新手友好度 82/100
digitalfabrik/integreat-cms#4621 ·
维护者通常 5 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
ioos/compliance-checker#1375 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复