Allow teachers to share libraries with their classmates - #35738
#35738Allow teachers to share libraries with their classmates#35738jmkulwik merged 2 commits intostagingcode-dot-org/code-dot-org:stagingfrom fix-teacher-share-librariescode-dot-org/code-dot-org:fix-teacher-share-librariesCopy head branch name to clipboard
Conversation
| project_owner = section_users.find {|user| user.id == student_storage_ids[project[:storage_id]]} | ||
| project_data = get_library_row_data(project, channel_id, section.name, project_owner) | ||
| if project_data && (project_owner.user_type == 'student' || project_data[:sharedWith].include?(section.id)) | ||
| if project_data && (project_owner.id != section.user_id || project_data[:sharedWith].include?(section.id)) |
There was a problem hiding this comment.
this change will still exclude the teacher's libraries (since section.user_id is the teacher's ID). i thought we wanted to include the teacher's libraries in this list?
related but separate: lines 129 and 132 (where we assign student_storage_ids and student_storage_id_list ) should probably be updated since section_users includes students and the teacher
There was a problem hiding this comment.
We want to include all classmates' libraries in the list, but we don't want to include the section owner's libraries in the list.
Details here:
https://docs.google.com/document/d/1zZ6WU5oBfh5Ra5TkdUpYRFsoMpIu9MRCWO42oBMyhrM/edit#
There was a problem hiding this comment.
ahh, my bad, i had to re-read the slack thread
There was a problem hiding this comment.
can we cover this case with a unit test to prevent a regression?
maddiedierker
left a comment
There was a problem hiding this comment.
LGTM! thank you, jessie 😄
We discovered that when we disabled auto-sharing of libraries from teachers to students, we also unintentionally disabled auto-sharing of libraries from teachers to classmates.
slack thread
This has updated our rules so teachers can auto-share libraries with classmates (For example: other teachers at a training)
Links
spec
Testing story
Reviewer Checklist: