Skip to content

Enforce courses.view_course_info in ListInstructorTasks #682

Backlog

Description

@BryanttV

Description

ListInstructorTasks (POST /courses/<course_id>/instructor/api/list_instructor_tasks) lists the running instructor tasks of a course. It hasn't been migrated to AuthZ yet: it still checks only the legacy instructor.show_tasks permission. With authz.enable_course_authoring enabled for a course, access to it doesn't follow the user's AuthZ roles, unlike the endpoints already migrated (#485). The Instructor Dashboard MFE calls it to show the pending tasks list, so it should require courses.view_course_info.

Current Behavior

ListInstructorTasks (lms/djangoapps/instructor/views/api.py) uses permission_classes = (IsAuthenticated, permissions.InstructorPermission) with permission_name = permissions.SHOW_TASKS (course staff or data_researcher). It delegates to _list_instructor_tasks, which also has @require_course_permission(permissions.SHOW_TASKS). AuthZ is never consulted.

Expected Behavior

  • With authz.enable_course_authoring enabled for the course, the endpoint returns the task list to users who hold courses.view_course_info and 403 to everyone else.
  • With the flag disabled, access stays the same as today (instructor.show_tasks).

Acceptance Criteria

  • ListInstructorTasks uses InstructorAuthzPermission with authz_permissions = (COURSES_VIEW_COURSE_INFO.identifier,).
  • permission_name stays permissions.SHOW_TASKS, so the legacy check is unchanged when the flag is disabled.
  • @require_course_permission(permissions.SHOW_TASKS) on _list_instructor_tasks doesn't reapply the legacy check on top of AuthZ for this endpoint.
  • A user without courses.view_course_info gets 403 in the standard format (error_code: permission_denied).
  • Tests cover a user with Course Admin, one with Course Staff and one without permission, with the flag enabled.
  • Users with the equivalent legacy role and no AuthZ role keep their access.
  • The other callers of _list_instructor_tasks (for example the legacy GET path) keep their current behavior.

Technical Notes

  • Follow the pattern of the endpoints already migrated in lms/djangoapps/instructor/views/api_v2.py. See InstructorAuthzPermission in lms/djangoapps/instructor/authz/permissions.py.
  • The default legacy check of courses.view_course_info in LEGACY_PERMISSION_CHECKS is instructor.view_dashboard, which is broader than instructor.show_tasks. Keeping permission_name = SHOW_TASKS on the view avoids widening legacy access.
  • The MFE (frontend-app-instructor-dashboard, fetchPendingTasks in src/data/api.ts) shows pending tasks on the Course Info, Grading, Certificates and Data Downloads pages. A user who can open one of those tabs but lacks courses.view_course_info will get 403 for the pending tasks list.

Out of Scope

  • InstructorTasks (GET tasks/<course_id>), ListEntranceExamInstructorTasks, InstructorTaskListView and TaskStatusView.

Related Issues

Activity

  1. changed the title [-]Enforce `courses.view_course_info` in `ListInstructorTasks[/-] [+]Enforce `courses.view_course_info` in `ListInstructorTasks`[/+] on Dec 4, 2026
  2. moved this to Ready for Development in RBAC AuthZ Boardon Dec 4, 2026
  3. added
    willow
    on Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    willow

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions