Skip to content

Lms id fix#329

Merged
gobears01 merged 9 commits into
mainfrom
lms-id-fix
Apr 30, 2026
Merged

Lms id fix#329
gobears01 merged 9 commits into
mainfrom
lms-id-fix

Conversation

@noahnizamian
Copy link
Copy Markdown

General Info

CDSS issue: berkeley-cdss#304

Changes

New controller with role based auth
Added teacher? method to UserToCourse model for role checking
Uses proper foreign key instead of possibly invalid string LMS references
LMS information can be centralized in the LMS table and changes now occur in a single place

Testing

Run the full rspec test suite to test for changes

Documentation

No documentation needed

Checklist

  • Name of branch corresponds to story
  • 80%+ test coverage with all tests passing

- Implemented user_to_courses_controller.rb with role-based authorization
- PATCH endpoint to toggle allow_extended_requests on enrollments
- Authorization: only teachers can toggle
- Uses lms_id FK pattern from LMS credentials refactoring
- Added teacher? method to UserToCourse model for role checking
- Complete spec with 7 test scenarios (instructor, student, missing resources)
- All tests passing: 365 examples, 0 failures, 80.88% coverage
@noahnizamian noahnizamian self-assigned this Mar 6, 2026
Comment thread .tool-versions Outdated
Comment thread Gemfile
Comment thread Gemfile.lock
Comment thread Gemfile.lock
Shklalom pushed a commit that referenced this pull request Mar 12, 2026
Copy link
Copy Markdown

@gobears01 gobears01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit is passing all tests after rebasing. I also fixed the authorize_instructor method per the comment below. I'm merging this to main

Comment thread app/controllers/user_to_courses_controller.rb Outdated
Comment thread app/controllers/user_to_courses_controller.rb
@gobears01 gobears01 merged commit 4b54eef into main Apr 30, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants