Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Admin course and student management pages don't work for admins

未关闭
#380 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@DarioDeSilva 已经在做这个了。

开始于 2026年10月7日。

  • #378 来自 @DarioDeSilva —— 未关闭

评估

难度
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 ignores user_id and returns the logged-in user's own enrollments. The page shows the admin's courses, not the student's.

Options:

  1. Let a global admin pass these course checks, either inside require_course_role or with separate admin endpoints.
  2. 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 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

kiat/codeAssist 的其他 Issue

查看 kiat/codeAssist 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。