fix(学生管理员): 260 班看板 23 人、数据统计只有 22 人,学生管理员还能看同学的作业代码——学生管理员一律按学生算
Deploy / deploy (push) Canceled after 0s
Deploy / deploy (push) Canceled after 0s
- 统计、题目页各班表、流程图统计的班级名单原来只认普通用户,改成和看板、排行榜一样的 STUDENT_ROLES,学生管理员进名单、进分母 - 看别人的提交代码和流程图只给老师、超管和出题人;题单防抄对学生管理员也生效。 原来「比赛进行中学生管理员不能看」那条特例随之去掉 - 题单的「用户进度」原来只给题单创建者,其余老师点开报「题单不存在」;改成所有老师都能看, 和看板、统计对所有班开放一致。后台能改能删的接口仍只给创建者 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
30f34f0e36
commit
af2ca31de5
6 files changed
+52
-47
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { type ProblemStats } from "@oj2/contract"
|
||||
import { STUDENT_ROLES, type ProblemStats } from "@oj2/contract"
|
||||
import { and, count, eq, inArray, sql } from "drizzle-orm"
|
||||
import { Hono } from "hono"
|
||||
|
||||
@@ -185,7 +185,7 @@ async function classRows(problemId: number): Promise<NonNullable<ProblemStats["c
|
||||
.where(
|
||||
and(
|
||||
inArray(schema.user.className, names),
|
||||
eq(schema.user.adminType, "Regular User"),
|
||||
inArray(schema.user.adminType, [...STUDENT_ROLES]),
|
||||
eq(schema.user.isDisabled, false),
|
||||
),
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user