f-1251 Add blind grading permission foundation - #1562
Open
morozov-av wants to merge 2 commits into
Open
morozov-av wants to merge 2 commits into
morozov-av wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new module breaks supported Python 3.10 deployments, and concurrent grader grants can raise uniqueness errors.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Adds the persistence and authorization foundation for delegated blind grading without integrating it into production routes.
Changes:
- Adds course grader membership and assignment blind-grading policy storage.
- Introduces fail-closed grading capability resolution.
- Adds migration and permission-focused tests.
| File | Description |
|---|---|
components/rsptx/auth/grader_permissions.py |
Resolves instructor and delegated-grader capabilities. |
components/rsptx/db/crud/grading_permissions.py |
Adds grader membership and policy persistence helpers. |
components/rsptx/db/crud/__init__.py |
Exports the new persistence helpers. |
components/rsptx/db/models.py |
Defines grader membership and assignment policy fields. |
migrations/versions/c2f8a1d4e7b9_add_blind_grading_foundation.py |
Migrates the database schema. |
test/components/rsptx/auth/test_grader_permissions.py |
Tests membership, policy, and capability behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+4
to
+13
| from enum import StrEnum | ||
|
|
||
| from rsptx.db.crud import ( | ||
| fetch_assignment_grading_policy, | ||
| fetch_instructor_courses, | ||
| is_course_grader, | ||
| ) | ||
|
|
||
|
|
||
| class GraderRole(StrEnum): |
Member
There was a problem hiding this comment.
We don't use python 3.10 anymore. The minimum python should be 3.13
Comment on lines
+28
to
+32
| membership = result.scalar_one_or_none() | ||
| if membership is None: | ||
| membership = CourseGrader(course_id=course_id, user_id=user_id) | ||
| session.add(membership) | ||
| await session.flush() |
Member
There was a problem hiding this comment.
I don' t think this is a real concern since requests are going to be generated from the UI
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.


Summary
Adds the backend foundation for delegated and blind grading:
blind_gradingassignment flagThis PR does not change existing grading routes or UI behavior. Instructor access remains unchanged, and delegated graders are not yet connected to production endpoints.
Follow-up
In next PRs I will add the anonymous grading API and React workflow