-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
fix: limited staff cohorts and gradebook access [BB-7962] #33491
fix: limited staff cohorts and gradebook access [BB-7962] #33491
Conversation
Thanks for the pull request, @0x29a! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
@0x29a, given the upcoming RBAC changes, I believe it's a reasonable tradeoff to make this work. Just please annotate this as a |
310e1c1
to
0e5e148
Compare
Thanks for the fast review, @Agrendalath! Updated. |
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.
👍
- I tested this: checked that the cohorts tab and gradebook work correctly
- I read through the code
- I checked for accessibility issues: n/a
- Includes documentation: n/a
- I made sure any change in configuration variables is reflected in the corresponding client's
configuration-secure
repository: n/a
Can we add something in the comment linking to an epic or ticket or something that will enable the hack to be removed? And ideally a target removal date? |
@rgraber, we added this role (along with a simple implementation of the role inheritance) in #32570, as there was no way of restricting staff member access to Studio. From this document it looks like that the LMS and Studio permissions will be separated in openedx/platform-roadmap#246, so we should be able to remove this then (or it will be reworked in the meantime, depending on the exact scope of the project). |
Can we put that in the code comment? Not a blocker, just want to reduce the risk of this malingering |
Limited Staff should not have studio read access by design. However, since many LMS views depend on the `has_course_author_access` check and `course_author_access_required` decorator, we have to allow write access until the permissions become more granular. For example, there should be STUDIO_VIEW_COHORTS and STUDIO_EDIT_COHORTS specifically for the cohorts endpoint, which is used to display "Cohorts" instructor dashboard tab.
0e5e148
to
dcacde5
Compare
@rgraber, sure thing. I added this context to the code comment. |
@0x29a 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
2U Release Notice: This PR has been deployed to the edX production environment. |
1 similar comment
2U Release Notice: This PR has been deployed to the edX production environment. |
Description
http://<LMS>/courses/<COURSE_KEY>/cohorts/
responds with 404 status code for users with Limited Staff role. This breaks "Cohorts" instructor dashboard tab, it's just empty.It happens due to this check:
edx-platform/openedx/core/djangoapps/course_groups/views.py
Lines 175 to 176 in bef05ab
edx-platform/common/djangoapps/student/auth.py
Lines 125 to 129 in bef05ab
edx-platform/common/djangoapps/student/auth.py
Lines 109 to 122 in bef05ab
So currently this endpoint requires Studio write permissions for both GET and POST requests. Unfortunately, the story is the same for many other endpoints that are necessary for LMS, at least:
SubsectionGradeView
,CourseGradingView
,GradebookView
,GradebookBulkUpdateView
.A proper solution would be to leave Limited Staff without any Studio access and expand this list with new flags:
edx-platform/common/djangoapps/student/auth.py
Lines 29 to 35 in bef05ab
However, in this case we'd have to add more decorators like
course_author_access_required
and / or do some refactoring. I don't know whether it's feasible giving the upcoming RBAC.Testing instructions