Commits
2026-07-19
🐛 fix: authz holes and stale-read races from the bug huntAhmet Kaan Gümüş · de938d8
🐛 fix: authz holes and stale-read races from the bug hunt - messages: a PATCH rejected on the folder no longer half-applies the read flag; the whole body validates before any write - messages: the delete-from-trash gate rides in the UPDATE's WHERE instead of a check-then-act window - notes: all nine handlers now require the student role — the read-only parent role could create notes and upload files (new RequireStudent) - reports: a parent link whose student side changed role is inert; ensure_can_observe re-reads the target's live role like enrollments - exams: update_exam takes the EXAM_LOCK writer lease before reading the row its merge defaults and draft/mode gates judge Re-link keeping one tie while linked_by moves to the latest linker is deliberate (matches re-enroll); doc reworded to say so.
2026-07-12
✨ feat(attendance): course sessions, roll call, work log, reportsAhmet Kaan Gümüş · 5b6aac1
✨ feat(attendance): course sessions, roll call, work log, reports
- course_session: a course's lesson (teacher, topic, required starts_at,
optional ends_at); managed under course rights like exams; explicit
teacher_id must hold teacher+; lists ordered by starts_at (timetable)
- session_attendance roll call: one row per session+user by composite id,
course denormalized so reports need no join; students never self-mark —
the session's teacher or a course manager marks enrolled students, and
the teacher's own presence row is manager+ only (no self-declared
presence); session/course deletes cascade roll-call rows
- work_entry staff timesheet (teacher+): check-in/out stamped by the
server clock only, so a client clock or crafted request can't forge
presence; one open stint per user held atomically — INSERT IGNORE on
the deterministic open_{user} id, check-out takes it via DELETE RETURN
BEFORE and re-files under a ULID; manager+ reads any log, corrects
closed stints (ordered instants), deletes entries
- attendance reports at /attendance/me and /attendance/{user} (teacher+),
mirroring the marks report: event tallies + session tallies +
per-course breakdown; rate = (present+late)/(present+absent+late) —
late attends, excused counts against no one; unenrolling hides marks
but never absences (attendance is a historical record)
- RequireManager extractor; check_time_range shared by events/sessions2026-07-11
✨ feat(web): axum handlers, DTOs, and auth extractorsAhmet Kaan Gümüş · 3c4822c
✨ feat(web): axum handlers, DTOs, and auth extractors The HTTP layer over the domain. DTOs are plain strings on the wire; handlers parse them into validated newtypes before touching the database. Responses share one UserResponse shape (id, username, role). Auth is a session cookie: login sets an HttpOnly, SameSite=Lax `session` cookie (Secure when configured) backed by a server-side row; logout is idempotent. Extractors encode access control by type — CurrentUser for any logged-in caller, RequireTeacher / RequireAdmin for role-gated routes — with the role re-read every request so a change takes effect on the next call. Routers: auth (register/login/logout/me), users (admin listing + role changes), notes (per-user CRUD), events + attendance, and exams + results. Ownership and role rules live in the handlers: event/exam edits are creator-or-manager+, grading is teacher+ and never targets oneself, and admins can't change their own role.