Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix observer enrollment impacting section privileges of teacher #2246

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cgravatt
Copy link
Contributor

visibility_limited_to_course_sections? should return true if all of the enrollments have limited_section_privileges ignoring observer enrollments

closes gh-2245

Test Plan:

  • Enroll a teacher in a section of course with limit section privileges set to true
  • Enroll a student in a different section of the same course with limit section privileges set to true
  • Set up the teacher as an observer of the student (for example the teacher teaches a section of a course but has a son or daughter taking a different section of the same course) Confirm the teacher cannot view all sections and can only see the two sections.

When creating observer enrollments, copy the limit_course_section_privilege value over from the student enrollment

 closes instructuregh-2245

 Test Plan:
   - Enroll a teacher in a section of course with limit section privileges set to true
   - Enroll a student in a different section of the same course with limit section privileges set to true
   - Set up the teacher as an observer of the student (for example the teacher teaches a section of a course but has a son or daughter taking a different section of the same course)
   Confirm the teacher cannot view all sections and can only see the two sections.
@cgravatt cgravatt force-pushed the 2245-fix-observer-enrollment-impacting-limit-section-privileges branch from b10e898 to 593e1a1 Compare August 16, 2023 13:00
student = user_with_pseudonym
@course.enroll_student(student, enrollment_state: "active", section: @section1, limit_privileges_to_course_section: true)
add_linked_observer(student, limited_teacher)
expect(@course.course_section_visibility(limited_teacher)).to eq [@section1.id, @section2.id]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

test fails and returns :all before change

@cgravatt
Copy link
Contributor Author

Any feedback on this?

@cgravatt
Copy link
Contributor Author

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants