-
Notifications
You must be signed in to change notification settings - Fork 0
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
refactor: consider user role staff for masquerading #27
Conversation
16b6513
to
22e61be
Compare
@mariajgrimaldi When I select view course as staff, and click the File "/openedx/requirements/xblock-mindmap/mindmap/mindmap.py", line 472, in get_instructor_grading_data
require(self.is_instructor())
File "/openedx/requirements/xblock-mindmap/mindmap/mindmap.py", line 778, in require
raise PermissionDenied
django.core.exceptions.PermissionDenied |
@BryanttV: no, thanks. I'll make sure to fix it right away. |
@BryanttV: can you test again? Thanks! |
Perfect, it works! |
mindmap/mindmap.py
Outdated
@@ -589,7 +589,7 @@ def remove_grade(self, data, _suffix="") -> dict: | |||
# Lazy import: import here to avoid app not ready errors | |||
from submissions.api import reset_score # pylint: disable=import-outside-toplevel | |||
|
|||
require(self.is_instructor()) | |||
require(self.is_instructor() or self.is_course_staff(self.get_current_user())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this a property?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. But I'll need to do some refactoring first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done @Ian2012. Can you check again?
f4bc7c8
to
bb8cbd5
Compare
There have been some changes after you @BryanttV reviewed, can you check again? Thanks! |
bb8cbd5
to
0a36208
Compare
0a36208
to
41b0055
Compare
Description
This PR considers the
staff
course role as well so masquerading as a course staff works too. I'm trying to figure out what causes this behavior. To reproduce:staff
.The
Grade Submissions
should disappear after this. What happens is that when you enter the course you have theinstructor
role, but then you view the course as staff (after pressing view as staff) now you have thestaff
role. So even though you reload the page or enter the course again, theGrade Submissions
button won't appear again unless you log out your account and login again.