-
Notifications
You must be signed in to change notification settings - Fork 623
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
User#can_edit? may prevent editing by a user who has multiple roles in a course #5948
Comments
Hi @ragesoss , please i would like to work on this |
I am currently trying to set up my development environment @ragesoss. I will get started on the issue as soon as i get it running |
Hi @ragesoss , please I am having trouble finding where the unit tests are. Can you help point me to the directory? |
Hi @TunrayoIlawole which unit test are you looking for? If you are looking for the test for the #can_edit, it is found in the user_spec.rb file in the spec folder, |
Thank you @Formasitchijoh |
What is happening?
The facilitator for this event, who is also participating as an editor, reports an permissions error when trying to edit the tracked wikis: https://outreachdashboard.wmflabs.org/courses/Wikimedians_of_Kerala/Wiki_Loves_Onam_2024/home
I think this is because of the implementation of
User#role
, which looks for a single CoursesUsers record, so if the wrong one is found the user will be treated as a 'student' rather than 'instructor'.Additional context
A fix for this should include a unit test for
#can_edit?
that fails with the current implementation but passes with a fixed implementation.The text was updated successfully, but these errors were encountered: