You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enforce the new permissions in the LMS endpoints used by each Instructor Dashboard tab. The shared infrastructure (#486) comes first; the per-tab subtasks can then be worked on in parallel.
Common acceptance criteria
Every endpoint of the tab checks the right permission and returns 403 in the standard format (error_code: permission_denied).
Tests cover a user with Course Admin, one with Course Staff and one without permission.
Users with the equivalent legacy role and no AuthZ role keep their access.
The tab's visibility in CourseMetadataView matches the tab's read permissions.
Hi! I ran the end-to-end tests for the Instructor Dashboard PRs under this issue, all merged together: #39402, #39403, #39365, #39366, #39362 and #39363 on openedx-platform, and #273 to #276 on frontend-app-instructor-dashboard. The tests are in tests/rbac/instructor-dashboard/ of my end-to-end-tests fork.
These two tests check the Course Info tab first and stop at the first difference, so they didn't reach the Enrollments tab controls.
Why these were expected:
With the flag on, Course Limited Staff (AuthZ) and Course Data Researcher (AuthZ) keep the access of their legacy role (compat.py), and their API tests for this tab passed.
Tests with the flag on
The roles whose expected results for this tab change when the flag turns on, and the tests with a different result.
#
Test
Result
1
Admin (legacy), not migrated: Course Info and Enrollments actions through the API
skipped (manual mode)
2
Staff (legacy), not migrated: Course Info and Enrollments actions through the API
skipped (manual mode)
3
Course Limited Staff (AuthZ): Course Info and Enrollments tab controls in the MFE
different
4
Course Data Researcher (AuthZ): Course Info and Enrollments tab controls in the MFE
different
Course Team (#39365, frontend-app-instructor-dashboard#273)
Differences with the flag on:
#
Role
Action
Got
Expected
1
Discussion Admin (legacy) migrated to Course Staff (AuthZ)
add and remove a forum role
403 with error_code: permission_denied
2xx
Why these were expected:
openedx-authz#376 expects that "Legacy role behavior is preserved unless explicitly changed", and with the flag off the Discussion Admin (legacy) test adds and removes forum roles.
Differences with the flag off:
#
Role
Action
Got
Expected
1
Discussion Admin (legacy)
add and remove a member with a course role
403 without error_code
403 with error_code: permission_denied
Why these were expected:
This issue asks every endpoint of a tab to return 403 in the standard format, error_code: permission_denied.
Tests with the flag on
The roles whose expected results for this tab change when the flag turns on, and the tests with a different result.
#
Test
Result
1
Course Staff (AuthZ): Course Team actions through the API
passed
2
org-wide Course Staff (AuthZ): Course Team actions through the API
passed
3
Discussion Admin (legacy) migrated to Course Staff (AuthZ): Course Team actions through the API
passed
4
Course Editor (AuthZ): Course Team actions through the API
passed
5
Course Auditor (AuthZ): Course Team actions through the API
passed
6
Admin (legacy), not migrated: Course Team actions through the API
skipped (manual mode)
7
Staff (legacy), not migrated: Course Team actions through the API
skipped (manual mode)
8
Course Staff (AuthZ) cannot give themselves the instructor role
passed
9
Discussion Admin (legacy) migrated to Course Staff (AuthZ) adds and removes forum roles
different
10
Course Staff (AuthZ): Course Team tab controls in the MFE
passed
11
org-wide Course Staff (AuthZ): Course Team tab controls in the MFE
passed
12
Discussion Admin (legacy) migrated to Course Staff (AuthZ): Course Team tab controls in the MFE
passed
13
Course Editor (AuthZ): Course Team tab controls in the MFE
passed
14
Course Auditor (AuthZ): Course Team tab controls in the MFE
Discussion Admin (legacy) migrated to Course Staff (AuthZ)
v1 reset_student_attempts with delete_module
2xx
403
4
Course Limited Staff (AuthZ)
All Learners reset and rescore
403 without error_code
403 with error_code: permission_denied
v1 reset_student_attempts with delete_module
2xx
403
5
Course Limited Staff (AuthZ)
Grading tab in the MFE
Access Denied alert
Grading controls
Why these were expected:
Rows 1 to 4, v1 delete state: reset_student_attempts documents delete_module as needing instructor access (api.py).
Row 4, All Learners: this issue asks every endpoint of a tab to return 403 in the standard format, error_code: permission_denied.
Row 5: With the flag on, Course Limited Staff (AuthZ) keeps the access of its legacy role (compat.py), and its API tests for this tab passed.
Differences with the flag off:
Staff (legacy), Org Staff (legacy), Discussion Admin (legacy), Limited Staff (legacy), and Course Staff (AuthZ), org-wide Course Staff (AuthZ) and Course Limited Staff (AuthZ) assigned while the flag is off, got the same two differences (7 tests).
Action
Got
Expected
All Learners reset and rescore
403 without error_code
403 with error_code: permission_denied
v1 reset_student_attempts with delete_module
2xx
403
Why these were expected:
All Learners: this issue asks every endpoint of a tab to return 403 in the standard format, error_code: permission_denied.
The roles whose expected results for this tab change when the flag turns on, and the tests with a different result.
#
Test
Result
1
Course Staff (AuthZ): learner search and Grading actions through the API
different
2
org-wide Course Staff (AuthZ): learner search and Grading actions through the API
different
3
Discussion Admin (legacy) migrated to Course Staff (AuthZ): learner search and Grading actions through the API
different
4
Course Editor (AuthZ): learner search and Grading actions through the API
passed
5
Course Auditor (AuthZ): learner search and Grading actions through the API
passed
6
Course Limited Staff (AuthZ): learner search and Grading actions through the API
different
7
Admin (legacy), not migrated: learner search and Grading actions through the API
skipped (manual mode)
8
Staff (legacy), not migrated: learner search and Grading actions through the API
skipped (manual mode)
9
Course Staff (AuthZ): Grading tab controls in the MFE
passed
10
org-wide Course Staff (AuthZ): Grading tab controls in the MFE
passed
11
Discussion Admin (legacy) migrated to Course Staff (AuthZ): Grading tab controls in the MFE
passed
12
Course Editor (AuthZ): Grading tab controls in the MFE
passed
13
Course Auditor (AuthZ): Grading tab controls in the MFE
passed
14
Course Limited Staff (AuthZ): Grading tab controls in the MFE
different
Date Extensions (#39362, frontend-app-instructor-dashboard#274)
Differences with the flag on:
#
Role
Action
Got
Expected
1
Course Editor (AuthZ)
list, grant and reset extensions
403 without error_code
403 with error_code: permission_denied
2
Course Auditor (AuthZ)
list, grant and reset extensions
403 without error_code
403 with error_code: permission_denied
3
Course Beta Tester (AuthZ)
list, grant and reset extensions
403 without error_code
403 with error_code: permission_denied
4
CCX Coach (legacy) migrated to CCX Coach (AuthZ)
list, grant and reset extensions
403 without error_code
403 with error_code: permission_denied
5
Learner (enrolled, no role)
list, grant and reset extensions
403 without error_code
403 with error_code: permission_denied
6
Course Data Researcher (AuthZ)
learner search and list extensions
2xx
403 with error_code: permission_denied
grant and reset extensions
403 without error_code
403 with error_code: permission_denied
Why these were expected:
Denials without error_code: this issue asks every endpoint of a tab to return 403 in the standard format, error_code: permission_denied.
Row 6, learner search and list: The legacy rule for extensions needs the staff access level (permissions.py), which Data Researcher doesn't have, and Course Data Researcher keeps its legacy access with the flag on (compat.py).
Differences with the flag off:
#
Role
Action
Got
Expected
1
Data Researcher (legacy)
learner search and list extensions
2xx
403 with error_code: permission_denied
grant and reset extensions
403 without error_code
403 with error_code: permission_denied
2
Course Data Researcher (AuthZ), assigned while the flag is off
learner search and list extensions
2xx
403 with error_code: permission_denied
grant and reset extensions
403 without error_code
403 with error_code: permission_denied
3
Beta Tester (legacy)
list, grant and reset extensions
403 without error_code
403 with error_code: permission_denied
4
Course Beta Tester (AuthZ), assigned while the flag is off
list, grant and reset extensions
403 without error_code
403 with error_code: permission_denied
5
Course Editor (AuthZ), assigned while the flag is off
list, grant and reset extensions
403 without error_code
403 with error_code: permission_denied
6
Course Auditor (AuthZ), assigned while the flag is off
list, grant and reset extensions
403 without error_code
403 with error_code: permission_denied
7
CCX Coach (legacy)
list, grant and reset extensions
403 without error_code
403 with error_code: permission_denied
8
Learner (enrolled, no role)
list, grant and reset extensions
403 without error_code
403 with error_code: permission_denied
Why these were expected:
Denials without error_code: this issue asks every endpoint of a tab to return 403 in the standard format, error_code: permission_denied.
Rows 1 and 2, learner search and list: The legacy rule for extensions needs the staff access level (permissions.py), which Data Researcher doesn't have, and Course Data Researcher keeps its legacy access with the flag on (compat.py).
Tests with the flag on
The roles whose expected results for this tab change when the flag turns on, and the tests with a different result.
#
Test
Result
1
Course Staff (AuthZ): learner search and Date Extensions actions through the API
passed
2
org-wide Course Staff (AuthZ): learner search and Date Extensions actions through the API
passed
3
Discussion Admin (legacy) migrated to Course Staff (AuthZ): learner search and Date Extensions actions through the API
passed
4
Course Editor (AuthZ): learner search and Date Extensions actions through the API
different
5
Course Auditor (AuthZ): learner search and Date Extensions actions through the API
different
6
Course Data Researcher (AuthZ): learner search and Date Extensions actions through the API
different
7
Course Beta Tester (AuthZ): learner search and Date Extensions actions through the API
different
8
CCX Coach (legacy) migrated to CCX Coach (AuthZ): learner search and Date Extensions actions through the API
different
9
Admin (legacy), not migrated: learner search and Date Extensions actions through the API
skipped (manual mode)
10
Staff (legacy), not migrated: learner search and Date Extensions actions through the API
skipped (manual mode)
11
Learner (enrolled, no role): learner search and Date Extensions actions through the API
different
12
Course Staff (AuthZ): Date Extensions tab controls in the MFE
passed
13
org-wide Course Staff (AuthZ): Date Extensions tab controls in the MFE
passed
14
Discussion Admin (legacy) migrated to Course Staff (AuthZ): Date Extensions tab controls in the MFE
passed
15
Course Staff (AuthZ): grants and resets an extension from the Date Extensions tab
passed
16
org-wide Course Staff (AuthZ): grants and resets an extension from the Date Extensions tab
passed
17
Discussion Admin (legacy) migrated to Course Staff (AuthZ): grants and resets an extension from the Date Extensions tab
With more than one worker, course creation deadlocks MySQL on tutor dev.
Run the specs, one per line:
npx playwright test tests/rbac/instructor-dashboard/access.spec.ts
npx playwright test tests/rbac/instructor-dashboard/course-info-enrollments.spec.ts
npx playwright test tests/rbac/instructor-dashboard/course-team.spec.ts
npx playwright test tests/rbac/instructor-dashboard/grading.spec.ts
npx playwright test tests/rbac/instructor-dashboard/date-extensions.spec.ts
npx playwright test tests/rbac/instructor-dashboard/cohorts.spec.ts
npx playwright test tests/rbac/instructor-dashboard/legacy-controls.spec.ts
npx playwright test tests/rbac/instructor-dashboard/flag-changes.spec.ts
The whole suite takes about 3 hours, and each spec can run on its own.
In short:
With the flag on:
The MFE shows Access Denied to Course Limited Staff (AuthZ) on Course Info, Grading and Cohorts, and to Course Data Researcher (AuthZ) on Course Info, while their API tests for those tabs passed.
On Date Extensions, Course Editor, Course Auditor, Course Beta Tester, the migrated CCX Coach and the learner get the list, grant and reset denials without error_code.
Course Data Researcher (AuthZ) can search learners and list extensions, and gets the grant and reset denials without error_code.
The Discussion Admin (legacy) migrated to Course Staff (AuthZ) gets 403 when adding or removing a forum role.
Course Limited Staff (AuthZ) gets the All Learners reset and rescore denials without error_code.
Course Staff (AuthZ), org-wide Course Staff (AuthZ), the migrated Discussion Admin and Course Limited Staff (AuthZ) can delete a learner's state through the v1 reset_student_attempts.
With the flag off:
On Date Extensions, 8 roles get denials without error_code, and Data Researcher (legacy) and Course Data Researcher (AuthZ) can search learners and list extensions.
On Grading, 7 roles get the All Learners denials without error_code and can delete a learner's state through the v1 reset_student_attempts.
Discussion Admin (legacy) gets 403 without error_code when adding or removing a course team member.
The manual-mode tests were skipped, because the stack ran the automatic migration only.
The Enrollments tab controls weren't checked for Course Limited Staff (AuthZ) and Course Data Researcher (AuthZ), because their test checks the Course Info tab first and stops at its difference.
Bullet 1: The Course Limited Staff and Course Data Researcher (AuthZ) roles will get the corresponding permissions for the tabs they can view (more context here). I'll be working on the changes in openedx-authz.
Bullet 2, 3, and 5: Views that don't inherit from DeveloperErrorViewMixin yet should do so, so that error_code is returned in the response.
Bullet 3: The behavior does happen, but it's not an AuthZ regression: Data Researcher behaves the same with the legacy role and with AuthZ. If we want to restrict that role from accessing those two endpoints, it should be fixed in the legacy validation.
Bullet 4: The Discussion Admin role doesn't have an AuthZ equivalent, so this broken behavior wouldn't apply. Also, forum endpoints aren't being considered for the migration either.
Bullet 6: The ResetStudentAttempts view wasn't migrated, since the Instructor Dashboard MFE doesn't use it. The behavior stays as it is right now. If we want to modify the legacy validation to match API v2, that should be a separate change.
With the flag off:
Bullet 1: What's related to the Data Researcher role (Legacy and AuthZ) is the same as Bullet 3 (flag on).
Bullet 2: The ResetStudentAttempts view wasn't migrated, since the Instructor Dashboard MFE doesn't use it. The behavior stays as it is right now.
Bullet 1, 2, and 3: Views that don't inherit from DeveloperErrorViewMixin yet should do so, so that error_code is returned in the response.
The necessary changes will be worked on in each of the PRs, as well as in openedx-authz.
Activity
course_groupsAPI) #492fix: return error_code permission_denied on Instructor AuthZ denials
fix: return error_code permission_denied on Instructor AuthZ denials
feat: enforce AuthZ permissions in the Instructor Dashboard API v2 (#…
mariajgrimaldi commentedon Nov 25, 2026
Hi! I ran the end-to-end tests for the Instructor Dashboard PRs under this issue, all merged together: #39402, #39403, #39365, #39366, #39362 and #39363 on openedx-platform, and #273 to #276 on frontend-app-instructor-dashboard. The tests are in
tests/rbac/instructor-dashboard/of my end-to-end-tests fork.Setup
maindev stack, run on 2026-11-25MJG/e2e-instructor-dashboard,masterwith #39402, #39403, #39365, #39366, #39362 and #39363MJG/e2e-instructor-dashboard-permissions,mainwith Bug - RBAC AuthZ - Course Admin gets 403 when assigning or removing roles on course scopes #273 to GET /api/authz/v1/assignments/ is slow due to too many queries on PolicyCacheControl #276authz.enable_course_authoringoff and onrole-matrix.tsResults:
Course Info and Enrollments (#39402, #39403)
Differences with the flag on:
These two tests check the Course Info tab first and stop at the first difference, so they didn't reach the Enrollments tab controls.
Why these were expected:
compat.py), and their API tests for this tab passed.Tests with the flag on
The roles whose expected results for this tab change when the flag turns on, and the tests with a different result.
Course Team (#39365, frontend-app-instructor-dashboard#273)
Differences with the flag on:
403witherror_code: permission_denied2xxWhy these were expected:
Differences with the flag off:
403withouterror_code403witherror_code: permission_deniedWhy these were expected:
403in the standard format,error_code: permission_denied.Tests with the flag on
The roles whose expected results for this tab change when the flag turns on, and the tests with a different result.
Grading (#39366, frontend-app-instructor-dashboard#276)
Differences with the flag on:
reset_student_attemptswithdelete_module2xx403reset_student_attemptswithdelete_module2xx403reset_student_attemptswithdelete_module2xx403403withouterror_code403witherror_code: permission_deniedreset_student_attemptswithdelete_module2xx403Why these were expected:
reset_student_attemptsdocumentsdelete_moduleas needing instructor access (api.py).403in the standard format,error_code: permission_denied.compat.py), and its API tests for this tab passed.Differences with the flag off:
Staff (legacy), Org Staff (legacy), Discussion Admin (legacy), Limited Staff (legacy), and Course Staff (AuthZ), org-wide Course Staff (AuthZ) and Course Limited Staff (AuthZ) assigned while the flag is off, got the same two differences (7 tests).
403withouterror_code403witherror_code: permission_deniedreset_student_attemptswithdelete_module2xx403Why these were expected:
403in the standard format,error_code: permission_denied.reset_student_attemptsdocumentsdelete_moduleas needing instructor access (api.py).Tests with the flag on
The roles whose expected results for this tab change when the flag turns on, and the tests with a different result.
Date Extensions (#39362, frontend-app-instructor-dashboard#274)
Differences with the flag on:
403withouterror_code403witherror_code: permission_denied403withouterror_code403witherror_code: permission_denied403withouterror_code403witherror_code: permission_denied403withouterror_code403witherror_code: permission_denied403withouterror_code403witherror_code: permission_denied2xx403witherror_code: permission_denied403withouterror_code403witherror_code: permission_deniedWhy these were expected:
error_code: this issue asks every endpoint of a tab to return403in the standard format,error_code: permission_denied.permissions.py), which Data Researcher doesn't have, and Course Data Researcher keeps its legacy access with the flag on (compat.py).Differences with the flag off:
2xx403witherror_code: permission_denied403withouterror_code403witherror_code: permission_denied2xx403witherror_code: permission_denied403withouterror_code403witherror_code: permission_denied403withouterror_code403witherror_code: permission_denied403withouterror_code403witherror_code: permission_denied403withouterror_code403witherror_code: permission_denied403withouterror_code403witherror_code: permission_denied403withouterror_code403witherror_code: permission_denied403withouterror_code403witherror_code: permission_deniedWhy these were expected:
error_code: this issue asks every endpoint of a tab to return403in the standard format,error_code: permission_denied.permissions.py), which Data Researcher doesn't have, and Course Data Researcher keeps its legacy access with the flag on (compat.py).Tests with the flag on
The roles whose expected results for this tab change when the flag turns on, and the tests with a different result.
Cohorts (#39363, frontend-app-instructor-dashboard#275)
Differences with the flag on:
Why these were expected:
compat.py), and its API tests for this tab passed.Tests with the flag on
The roles whose expected results for this tab change when the flag turns on, and the tests with a different result.
How to run the tests
maindev stack (withtutor-mfe,tutor-forumandtutor-notesfrommain) with the openedx-platform and MFE branches mounted:In
.env:With more than one worker, course creation deadlocks MySQL on
tutor dev.The whole suite takes about 3 hours, and each spec can run on its own.
In short:
error_code.error_code.403when adding or removing a forum role.error_code.reset_student_attempts.error_code, and Data Researcher (legacy) and Course Data Researcher (AuthZ) can search learners and list extensions.error_codeand can delete a learner's state through the v1reset_student_attempts.403withouterror_codewhen adding or removing a course team member.If any of these look wrong, please let me know!
BryanttV commentedon Nov 27, 2026
Thanks, @mariajgrimaldi. I'll reply to the report summary:
With the flag on:
DeveloperErrorViewMixinyet should do so, so thaterror_codeis returned in the response.ResetStudentAttemptsview wasn't migrated, since the Instructor Dashboard MFE doesn't use it. The behavior stays as it is right now. If we want to modify the legacy validation to match API v2, that should be a separate change.With the flag off:
ResetStudentAttemptsview wasn't migrated, since the Instructor Dashboard MFE doesn't use it. The behavior stays as it is right now.DeveloperErrorViewMixinyet should do so, so thaterror_codeis returned in the response.The necessary changes will be worked on in each of the PRs, as well as in openedx-authz.
mariajgrimaldi commentedon Nov 30, 2026
Thanks so much @BryanttV! I'm going to adapt the test cases according to your review, thanks!
courses.view_course_infoinListInstructorTasks#682courses.manage_learner_gradingdepend oncourses.view_gradebook#683