Improve Request#Show page for instructors with review information#455
Open
cycomachead wants to merge 1 commit into
Open
Improve Request#Show page for instructors with review information#455cycomachead wants to merge 1 commit into
cycomachead wants to merge 1 commit into
Conversation
- Introduce `RequestReviewPresenter` to encapsulate student history and approval metadata - Add `_student_extension_history` partial to display prior requests and status counts - Surface student email, LMS links, and projected late due dates on the show page - Replace string-based `@role == 'instructor'` checks with a cached `staff_user?` helper - Fix a security vulnerability in `AssignmentsController` by enforcing server-side permission checks - Resolve a latent test isolation bug by prefixing factory `canvas_uid` sequences Co-authored-by: Claude Code <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improve Request#Show Page for Instructors with Review Information
Surfaces the context an instructor needs to make an informed approval/denial decision on an extension request, and cleans up the underlying role-checking pattern across the app.
Changes
New instructor review context on
Request#Show:RequestReviewPresenter(app/presenters/request_review_presenter.rb) — encapsulates all the review-context data computation (student history, status counts, enrollment, projected dates) so the controller stays thin and the view reads from a single@reviewobject._student_extension_historypartial — the history table extracted into its own partial for clarity.staff_user?helper — replaces every@role == 'instructor'permission check across controllers and views with a semantic, memoized predicate that delegates toCourse#course_staff?. Available in both controllers and views viahelper_method.Security fix in
AssignmentsController#toggle_enabled— previously trusted a client-suppliedroleparam to determine authorization. Now uses the server-sidestaff_user?check exclusively.Testing
spec/presenters/request_review_presenter_spec.rb(8 examples) covering all presenter methods including edge cases (no enrollment, submitted after deadline, status counts excluding current request).showaction asserting template rendering and correct@reviewpresenter assignment.AssignmentsControllerignores a client-suppliedrole: 'instructor'param.#staff_user?specs covering staff-true, student-false, nil guards, and memoization correctness.usersfactory generated bare numericcanvas_uidsequences ("1","2", …) that would eventually collide with hardcoded UIDs in specs. Prefixed the sequence ("canvas-uid-#{n}") to prevent collisions across full suite runs.course_settings_controller_specenrollments that used a fictitiousrole: 'instructor'(not a real DB role); switched torole: 'teacher'.Full suite: 446 examples, 0 failures.
Documentation
No additional documentation required.
Checklist
Superconductor Ticket Implementation | App Preview | Guided Review