Repository navigation
Description
Description
The review of the Grading tab enforcement (openedx/openedx-platform#39366) showed that the current Instructor Dashboard permissions cannot express two things: who may run grading operations on all learners, and which permission covers each endpoint shared by several tabs. The agreed solution requires changes to the permission definitions in openedx-authz: split the grading permission, add a permission to view a learner's course status, widen View course info, and declare dependencies between permissions.
Current Behavior
courses.manage_learner_gradingcovers both Single Learner and All Learners operations, and is granted tocourse_adminandcourse_staff. Withauthz.enable_course_authoringenabled, enforcing it lets Course Staff reset attempts and rescore for all learners, which the legacy rules reserve for instructor access.- No permission specifically covers viewing a learner's course status (
LearnerView), which the Grading, Date Extensions, and Special Exams tabs all use. courses.view_course_infois described as "View general course information and enrollment counts in the Instructor Dashboard". It does not cover background task status (ListInstructorTasks), which several tabs use.- The Instructor Dashboard permissions declare no dependencies, so a custom role can include a permission without the ones its workflow needs.
Expected Behavior
Grading permissions
courses.manage_learner_grading is replaced by two permissions:
| Permission | Covers | course_admin |
course_staff |
|---|---|---|---|
courses.manage_learner_grades |
Single Learner operations | Yes | Yes |
courses.manage_bulk_learner_grades |
All Learners operations | Yes | No |
Shared endpoints
Each endpoint in openedx-platform checks the one permission that matches its functionality. There are no OR checks based on which tabs use the endpoint, so the default roles must include every permission their workflows need.
| Endpoint | Permission |
|---|---|
LearnerView |
courses.view_learner_course_status (new, shared by Grading, Date Extensions, and Special Exams) |
ProblemView |
courses.manage_learner_grades |
ListInstructorTasks |
courses.view_course_info, which now also covers background task status |
Permission dependencies
Custom roles cannot include a permission without the permissions it depends on:
| Permission | Depends on |
|---|---|
courses.manage_learner_grades |
courses.view_learner_course_status |
courses.manage_learner_extensions |
courses.view_learner_course_status |
courses.manage_bulk_learner_grades |
courses.manage_learner_grades |
courses.view_gradebook |
courses.view_course_info |
Acceptance Criteria
-
courses.manage_learner_gradesis defined for Single Learner operations and granted tocourse_adminandcourse_staff. -
courses.manage_bulk_learner_gradesis defined for All Learners operations and granted tocourse_admin, but not tocourse_staff. -
courses.manage_learner_gradingis removed from the schema, constants, public exports, tests, and docs. -
courses.view_learner_course_statusis defined with thecourse-v1scope and granted tocourse_adminandcourse_staff. - The description of
courses.view_course_infoincludes background task status. - The grading permission descriptions no longer claim to cover viewing learner progress or checking task status, which now belong to
courses.view_learner_course_statusandcourses.view_course_info. - The four dependencies in the table above are declared with
depends_onin schema version1.1files (ADR 0034). -
course_adminandcourse_staffpass the schema validation that requires a role to include all direct and indirect dependencies of its permissions. - A role that has only
courses.manage_bulk_learner_gradesand its dependencies includescourses.manage_learner_gradesandcourses.view_learner_course_status. - Running
load_authz_schemaon an existing installation adds the new policies and removes the ones forcourses.manage_learner_grading. - The new permissions have Python constants exported from
openedx_authz.authzandopenedx_authz.constants.permissions. - Tests cover the role grants (including the Course Staff denial for bulk operations) and the dependencies.
-
course_roles.rst,compiled-schema.yaml, and the CHANGELOG are updated. The CHANGELOG notes the removed permission and, for custom roles that grant it, theload_authz_schema --drop-custom-role-permissionsoption. - The package version is released so that
openedx-platformcan upgrade to it.
Out of Scope
- Changing the endpoint permission checks in
openedx-platform(feat: enforce AuthZ permissions in the Grading endpoints openedx-platform#39366 and related PRs). The shared endpoints table is included as context for the permission design. - Updating the permission constants in
frontend-app-instructor-dashboard. - Changing the legacy permission behavior when
authz.enable_course_authoringis disabled.
Dependencies
depends_onrequires feat: add permission dependencies to the authorization schema #648 (schema and validation). Enforcing dependencies throughg2rows requires feat: render permission dependencies as g2 rows #657 (storage and rendering).- Removing
courses.manage_learner_gradingis a breaking change for its consumers, which must be updated together with the version upgrade:openedx-platform:lms/djangoapps/instructor/authz/constants.pyimportsCOURSES_MANAGE_LEARNER_GRADINGand uses it inINSTRUCTOR_DASHBOARD_PERMISSIONSandTAB_PERMISSIONS;lms/djangoapps/instructor/authz/legacy.pymaps it inLEGACY_PERMISSION_CHECKS.frontend-app-instructor-dashboard:src/permissions/constants.tsdefinesMANAGE_LEARNER_GRADING.
- feat: enforce AuthZ permissions in the Grading endpoints openedx-platform#39366 needs these permissions to apply the agreed checks.
Technical Notes
- Grading definitions are in
src/openedx_authz/applets/learner_grading/(schema/permissions.yaml,schema/role_extensions.yaml,constants.py). view_course_infoandmanage_learner_extensionsare insrc/openedx_authz/applets/learner_administration/.- The agreement does not say which applet or permission category should own
courses.view_learner_course_status. Choose one following ADR 0032. - Some dependencies cross applets (for example,
view_gradebookdepends onview_course_info). - Expected role grants are also listed in
src/openedx_authz/tests/role_permissions.py. - In
openedx-platform, the new permissions also need legacy equivalents inLEGACY_PERMISSION_CHECKS. All Learners operations must keep requiring instructor access there.
Related Issues
- Part of Backend permission enforcement (LMS) #485
- Related to Enforcement: Grading tab #490
- Related to Implementation: Permission dependencies mapping via Yaml extensibility #560
- Related to feat: enforce AuthZ permissions in the Grading endpoints openedx-platform#39366
Notes or Additional Context
- Agreement on grading permissions, shared endpoints, and implication rules
- End-to-end test results for the Grading tab
- ADR 0034: Define Permission Dependencies in the Authorization Schema
- The Instructor Dashboard Permissions catalog should be updated to match these changes.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity