-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
TeacherEnrollment's limit section privileges for a course is overwritten when observing a student in the same course but different section #2245
Comments
I'm happy to contribute a PR to resolve this, but I'm not sure which direction would be preferred. I can see two possibilities. Option 1: Update create_linked_enrollment_for(observer) to copy over the limit_section_privileges value so that ObserverEnrollments are created with a limit_section_privileges value that matches the student Option 2: Update section_visibilities_for on the course model to exclude enrollments of type ObserverEnrollment from consideration. |
visibility_limited_to_course_sections? should return true if all of the enrollments have limited_section_privileges ignoring observer enrollments 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.
visibility_limited_to_course_sections? should return true if all of the enrollments have limited_section_privileges ignoring observer enrollments 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.
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.
Summary:
The limit section privileges on a TeacherEnrollment for a course is overwritten when observing a student in the same course but different section. Even when the student's enrollment has limit section privileges.
Steps to reproduce:
Expected behavior:
The teacher can observer the student and only see their enrolled section
Actual behavior:
Teacher is no longer limited to section and can see all sections.
Additional notes:
The text was updated successfully, but these errors were encountered: