From 5a7a0b7528c22e8d074aa328c873b387696944e9 Mon Sep 17 00:00:00 2001 From: Bryann Valderrama Date: Fri, 27 Nov 2026 13:43:29 -0500 Subject: [PATCH] feat: grant dashboard permissions to the course limited staff role The Instructor Dashboard MFE only checks AuthZ permissions, so it denied course_limited_staff access to tabs that the backend allows through the legacy fallback. Grant the role the permissions for the Course Info, Enrollments, Grading and Cohorts tabs. Bulk learner grading, learner extensions and course team permissions are not granted. Co-Authored-By: Claude Sonnet 5.5 --- CHANGELOG.rst | 4 ++++ docs/references/compiled-schema.yaml | 14 ++++++++++++++ .../applets/course_authoring/README.rst | 2 +- .../course_authoring/schema/role_extensions.yaml | 4 ++++ src/openedx_authz/applets/enrollments/README.rst | 2 +- .../enrollments/schema/role_extensions.yaml | 6 ++++++ .../applets/learner_administration/README.rst | 2 +- .../schema/role_extensions.yaml | 7 +++++++ .../applets/learner_grading/README.rst | 2 +- .../learner_grading/schema/role_extensions.yaml | 5 +++++ src/openedx_authz/tests/role_permissions.py | 10 ++++++++++ 11 files changed, 54 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7e02c2bba..eb99896fc 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -201,6 +201,10 @@ Fixed * ``DELETE /api/authz/v1/roles/users/`` no longer lets a user remove its own ``library_admin`` or ``course_admin`` role, matching the admin console. The user is reported in ``errors`` with ``cannot_remove_own_admin_role`` and keeps the role; other users in the request are processed. +* The hidden ``course_limited_staff`` role now grants the Instructor Dashboard permissions that match + its legacy access to the Course Info, Enrollments, Grading and Cohorts tabs, so the dashboard no + longer denies it access to them. It does not get bulk learner grading, learner extensions or course + team permissions. Run ``load_authz_schema`` to apply the new grants. 1.24.0 - 2026-09-14 ******************* diff --git a/docs/references/compiled-schema.yaml b/docs/references/compiled-schema.yaml index de08ab63e..f969de4e6 100644 --- a/docs/references/compiled-schema.yaml +++ b/docs/references/compiled-schema.yaml @@ -139,8 +139,22 @@ roles: icon: null hidden: true permissions: + course_authoring: + - courses.view_grading_settings course_team_roles: - courses.legacy_limited_staff_role_permissions + enrollments: + - courses.enroll_learners + - courses.unenroll_learners + - courses.view_enrollments + learner_administration: + - courses.manage_cohorts + - courses.view_cohorts + - courses.view_course_info + - courses.view_learner_course_status + learner_grading: + - courses.manage_learner_grading + - courses.view_gradebook course_staff: display_name: Course Staff description: Can publish content and manage the course lifecycle in Studio. diff --git a/src/openedx_authz/applets/course_authoring/README.rst b/src/openedx_authz/applets/course_authoring/README.rst index c932afc61..fb71fb00d 100644 --- a/src/openedx_authz/applets/course_authoring/README.rst +++ b/src/openedx_authz/applets/course_authoring/README.rst @@ -1,6 +1,6 @@ Course Authoring ################ -This applet owns the existing built-in permissions for authoring, configuring, and managing the team of a course. It adds those permissions to the shared course-team roles through role extensions, while the role identifiers and metadata remain in ``course_team_roles``. ``constants.py`` contains its permission objects. +This applet owns the existing built-in permissions for authoring, configuring, and managing the team of a course. It adds those permissions to the shared course-team roles through role extensions, while the role identifiers and metadata remain in ``course_team_roles``. The hidden ``course_limited_staff`` role only gets ``courses.view_grading_settings``, for the Grading tab of the Instructor Dashboard. ``constants.py`` contains its permission objects. The applet is an internal package, so clients import these constants from ``openedx_authz.authz``. The existing ``openedx_authz.constants.permissions`` path remains a compatibility export. diff --git a/src/openedx_authz/applets/course_authoring/schema/role_extensions.yaml b/src/openedx_authz/applets/course_authoring/schema/role_extensions.yaml index 29b35790d..7fc8576bd 100644 --- a/src/openedx_authz/applets/course_authoring/schema/role_extensions.yaml +++ b/src/openedx_authz/applets/course_authoring/schema/role_extensions.yaml @@ -109,3 +109,7 @@ role_extensions: - courses.view_certificates - courses.view_group_configurations - courses.view_library_updates + + - role_id: course_limited_staff + add_permissions: + - courses.view_grading_settings diff --git a/src/openedx_authz/applets/enrollments/README.rst b/src/openedx_authz/applets/enrollments/README.rst index f123a9ea6..5ac2bc1d7 100644 --- a/src/openedx_authz/applets/enrollments/README.rst +++ b/src/openedx_authz/applets/enrollments/README.rst @@ -1,6 +1,6 @@ Enrollments ########### -This applet owns the permissions for viewing course enrollments and for enrolling or unenrolling learners, which belong to the Content Access / Enrollments bounded context. It adds those permissions to the ``course_admin`` and ``course_staff`` roles through role extensions. ``constants.py`` contains its permission objects. +This applet owns the permissions for viewing course enrollments and for enrolling or unenrolling learners, which belong to the Content Access / Enrollments bounded context. It adds those permissions to the ``course_admin`` and ``course_staff`` roles through role extensions. It also adds them to the hidden ``course_limited_staff`` role. ``constants.py`` contains its permission objects. The applet is an internal package, so clients import these constants from ``openedx_authz.authz``. The existing ``openedx_authz.constants.permissions`` path remains a compatibility export. diff --git a/src/openedx_authz/applets/enrollments/schema/role_extensions.yaml b/src/openedx_authz/applets/enrollments/schema/role_extensions.yaml index 7fad37129..8443e06fd 100644 --- a/src/openedx_authz/applets/enrollments/schema/role_extensions.yaml +++ b/src/openedx_authz/applets/enrollments/schema/role_extensions.yaml @@ -13,3 +13,9 @@ role_extensions: - courses.view_enrollments - courses.enroll_learners - courses.unenroll_learners + + - role_id: course_limited_staff + add_permissions: + - courses.view_enrollments + - courses.enroll_learners + - courses.unenroll_learners diff --git a/src/openedx_authz/applets/learner_administration/README.rst b/src/openedx_authz/applets/learner_administration/README.rst index 48895c3cd..1cc1dc281 100644 --- a/src/openedx_authz/applets/learner_administration/README.rst +++ b/src/openedx_authz/applets/learner_administration/README.rst @@ -1,6 +1,6 @@ Learner Administration ###################### -This applet owns the permissions for viewing course information and a learner's course status, and managing learner extensions and cohorts, which belong to the Support Learning bounded context. It adds those permissions to the ``course_admin`` and ``course_staff`` roles through role extensions. ``constants.py`` contains its permission objects. +This applet owns the permissions for viewing course information and a learner's course status, and managing learner extensions and cohorts, which belong to the Support Learning bounded context. It adds those permissions to the ``course_admin`` and ``course_staff`` roles through role extensions. It also adds the ones matching the legacy limited staff access to the hidden ``course_limited_staff`` role. ``constants.py`` contains its permission objects. The applet is an internal package, so clients import these constants from ``openedx_authz.authz``. The existing ``openedx_authz.constants.permissions`` path remains a compatibility export. diff --git a/src/openedx_authz/applets/learner_administration/schema/role_extensions.yaml b/src/openedx_authz/applets/learner_administration/schema/role_extensions.yaml index 78d4dead6..f99d184f2 100644 --- a/src/openedx_authz/applets/learner_administration/schema/role_extensions.yaml +++ b/src/openedx_authz/applets/learner_administration/schema/role_extensions.yaml @@ -19,3 +19,10 @@ role_extensions: - courses.manage_learner_extensions - courses.view_cohorts - courses.manage_cohorts + + - role_id: course_limited_staff + add_permissions: + - courses.view_course_info + - courses.view_learner_course_status + - courses.view_cohorts + - courses.manage_cohorts diff --git a/src/openedx_authz/applets/learner_grading/README.rst b/src/openedx_authz/applets/learner_grading/README.rst index 0d0c69df4..2f2e29ed4 100644 --- a/src/openedx_authz/applets/learner_grading/README.rst +++ b/src/openedx_authz/applets/learner_grading/README.rst @@ -1,6 +1,6 @@ Learner Grading ############### -This applet owns the permissions for viewing the gradebook and using grading tools for individual learners or all learners, which belong to the Consuming Learning Content bounded context. It adds those permissions to the ``course_admin`` and ``course_staff`` roles through role extensions. ``constants.py`` contains its permission objects. +This applet owns the permissions for viewing the gradebook and using grading tools for individual learners or all learners, which belong to the Consuming Learning Content bounded context. It adds those permissions to the ``course_admin`` and ``course_staff`` roles through role extensions. It also adds the ones matching the legacy limited staff access to the hidden ``course_limited_staff`` role. ``constants.py`` contains its permission objects. The applet is an internal package, so clients import these constants from ``openedx_authz.authz``. The existing ``openedx_authz.constants.permissions`` path remains a compatibility export. diff --git a/src/openedx_authz/applets/learner_grading/schema/role_extensions.yaml b/src/openedx_authz/applets/learner_grading/schema/role_extensions.yaml index a732cd1c4..a6b3ff414 100644 --- a/src/openedx_authz/applets/learner_grading/schema/role_extensions.yaml +++ b/src/openedx_authz/applets/learner_grading/schema/role_extensions.yaml @@ -12,3 +12,8 @@ role_extensions: add_permissions: - courses.view_gradebook - courses.manage_learner_grading + + - role_id: course_limited_staff + add_permissions: + - courses.view_gradebook + - courses.manage_learner_grading diff --git a/src/openedx_authz/tests/role_permissions.py b/src/openedx_authz/tests/role_permissions.py index e189fd1a1..8edde0944 100644 --- a/src/openedx_authz/tests/role_permissions.py +++ b/src/openedx_authz/tests/role_permissions.py @@ -173,6 +173,16 @@ COURSE_LIMITED_STAFF_PERMISSIONS = [ COURSES_LEGACY_LIMITED_STAFF_ROLE_PERMISSIONS, + COURSES_VIEW_ENROLLMENTS, + COURSES_ENROLL_LEARNERS, + COURSES_UNENROLL_LEARNERS, + COURSES_VIEW_GRADEBOOK, + COURSES_MANAGE_LEARNER_GRADING, + COURSES_VIEW_COURSE_INFO, + COURSES_VIEW_LEARNER_COURSE_STATUS, + COURSES_VIEW_COHORTS, + COURSES_MANAGE_COHORTS, + COURSES_VIEW_GRADING_SETTINGS, ] COURSE_DATA_RESEARCHER_PERMISSIONS = [