refactor: consider user role staff for masquerading#27
Merged
Conversation
mariajgrimaldi
marked this pull request as ready for review
September 28, 2023 22:06
mariajgrimaldi
force-pushed
the
MJG/consider-staff-perm
branch
from
September 28, 2023 22:13
16b6513 to
22e61be
Compare
Contributor
|
@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 |
Contributor
Author
|
@BryanttV: no, thanks. I'll make sure to fix it right away. |
Contributor
Author
|
@BryanttV: can you test again? Thanks! |
Contributor
|
Perfect, it works! |
BryanttV
approved these changes
Sep 29, 2023
Ian2012
reviewed
Sep 29, 2023
| 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())) |
Contributor
There was a problem hiding this comment.
Can you make this a property?
Contributor
Author
There was a problem hiding this comment.
Yeah. But I'll need to do some refactoring first
mariajgrimaldi
force-pushed
the
MJG/consider-staff-perm
branch
3 times, most recently
from
October 2, 2023 17:22
f4bc7c8 to
bb8cbd5
Compare
Contributor
Author
|
There have been some changes after you @BryanttV reviewed, can you check again? Thanks! |
mariajgrimaldi
force-pushed
the
MJG/consider-staff-perm
branch
from
October 2, 2023 18:25
bb8cbd5 to
0a36208
Compare
BryanttV
approved these changes
Oct 2, 2023
Ian2012
approved these changes
Oct 2, 2023
mariajgrimaldi
force-pushed
the
MJG/consider-staff-perm
branch
from
October 2, 2023 19:25
0a36208 to
41b0055
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR considers the
staffcourse 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 Submissionsshould disappear after this. What happens is that when you enter the course you have theinstructorrole, but then you view the course as staff (after pressing view as staff) now you have thestaffrole. So even though you reload the page or enter the course again, theGrade Submissionsbutton won't appear again unless you log out your account and login again.