feat: add VIEW permission for advanced settings access control#38462
feat: add VIEW permission for advanced settings access control#38462bra-i-am wants to merge 2 commits intoopenedx:masterfrom
Conversation
|
Thanks for the pull request, @bra-i-am! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 🔘 Update the status of your PRYour PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate. Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
a42d8e6 to
4115799
Compare
ca746b2 to
30a662c
Compare
Description
Modifies
check_course_advanced_settings_accessincommon/djangoapps/student/auth.pyto supportread-only access for the
course_auditorrole by adding aCOURSES_VIEW_ADVANCED_SETTINGSpermission check.Changes
COURSES_VIEW_ADVANCED_SETTINGSto theopenedx_authzpermission importsaccess_typeparameter with three values:read,write, andfeature_restrictedaccess_typeis validated at the top of the function before any branchingMANAGEpermission satisfies all three access typesVIEWpermission satisfiesreadonly (auditor read-only access)DISABLE_ADVANCED_SETTINGSis enabled, onlyfeature_restrictedbypasses authz (staff/superuser only);readandwritestill go through authz normallyAUTHZ_COURSE_AUTHORING_FLAGis disabled:read→has_studio_read_accesswrite→has_studio_write_accessfeature_restricted→has_studio_advanced_settings_accessTesting instructions
AUTHZ_COURSE_AUTHORING_FLAGcourse_auditorrole to a user — they should be able to view Advanced Settings in Studio but all fields should be read-onlycourse_editororcourse_staffrole — user should have full read + write accessDISABLE_ADVANCED_SETTINGS—feature_restrictedshould only pass for staff/superuser;readandwriteshould still use authz normallyAUTHZ_COURSE_AUTHORING_FLAG— verify legacy fallback works for all three access typesSupporting information
COURSES_VIEW_ADVANCED_SETTINGS: feat: add advanced settings view permission for course roles openedx-authz#272course_auditorin the Advanced Settings page