Skip to content

Comments

feat: add license_enforcement logic.#178

Merged
anfbermudezme merged 4 commits intopearson/ulmofrom
vue/PADV-2726
Jan 2, 2026
Merged

feat: add license_enforcement logic.#178
anfbermudezme merged 4 commits intopearson/ulmofrom
vue/PADV-2726

Conversation

@anfbermudezme
Copy link

@anfbermudezme anfbermudezme commented Dec 29, 2025

Ticket

Description

This PR updates edx-platform to consume the new openedx_filters.license_enforcement filter contracts for the CCX / license_enforcement domain, replacing legacy run_extension_point-style behavior with explicit, pipeline-driven filter invocations.

With these changes, licensing-related decisions in CCX flows (tab visibility, coach dashboard access, pending enrollments, and enrollment enforcement) become configurable via OPEN_EDX_FILTERS_CONFIG and decoupled from platform internals, while preserving existing behavior when Course Licensing is not enabled.

This PR also includes related enrollment/invitation updates:

  • enrollment email link generation is aligned with the Learning MFE URL, and
  • enrollment allow-list creation is now interceptable via the Open edX filters pipeline.

Changes made

CCX + Course Licensing integration (filter-driven)

  • CCX Coach tab visibility now respects Course Licensing enablement:
    • When licensing is enabled and the course is a master course (not a CCX), the CCX Coach tab is hidden unless the user is allowed to create CCXs (via CcxCreationPermissionRequested).
  • CCX coach dashboard access updated to use filter-based permissions:
    • When licensing is enabled, access to the coach dashboard on master courses is blocked unless CcxCreationPermissionRequested allows it.
    • When licensing is enabled, CCX-level staff access can be granted for licensed CCXs via CcxCoachTabAccessRequested.
  • Pending CCX enrollments are now obtained via CcxPendingEnrollmentsRequested and passed to the CCX dashboard context when licensing is enabled.
  • CCX bulk enrollment enforcement is now filter-driven:
    • When licensing is enabled, each candidate enrollment is validated via CcxEnrollmentLicenseEnforcementRequested.
    • If the filter denies (e.g., license limit reached), enrollment is blocked.

Instructor Dashboard behavior for licensed CCXs

  • When licensing is enabled, the Instructor Dashboard “Membership” section is hidden for licensed CCXs for non-admin staff users (via CcxLicensedStatusRequested).

CCX utilities / helpers

  • Added CCX helper utilities used by licensing/enrollment flows:
    • get_master_course_by_ccx_id
    • exclude_master_course_staff_users
    • multiple_ccx_per_coach (gated by ALLOW_MULTIPLE_CCX_PER_COACH site config)

Enrollment / invitation support

  • Updated enrollment email course_url generation to point to the Learning MFE (LEARNING_MICROFRONTEND_URL).
  • Enrollment allow-list creation now runs through Open edX filter hooks (e.g., CourseEnrollmentStarted) so pipelines can prevent enrollment-related operations when needed for Enrollments Allowed.

How to test

Automated

  • Run targeted LMS tests (adjust commands to your repo’s test layout as needed):
    • pytest lms/djangoapps/ccx/
    • pytest lms/djangoapps/instructor/

Manual / functional

  1. Baseline behavior (licensing disabled)

    • Ensure no OPEN_EDX_FILTERS_CONFIG pipeline step enables licensing.
    • Verify CCX Coach tab, CCX coach dashboard access, and CCX enrollment flows behave as before.
  2. Licensing enabled behavior

    • Configure OPEN_EDX_FILTERS_CONFIG so CourseLicensingEnabledRequested returns True and implement the licensing plugin steps for:
      • CcxCreationPermissionRequested
      • CcxCoachTabAccessRequested
      • CcxPendingEnrollmentsRequested
      • CcxEnrollmentLicenseEnforcementRequested
      • CcxLicensedStatusRequested
    • Verify:
      • A user without CCX creation permission does not see the CCX Coach tab on master courses and cannot access the master-course coach dashboard.
      • A permitted user can access the master-course coach dashboard when licensing is enabled.
      • Pending enrollments appear on the CCX dashboard when provided via the filter.
      • Bulk CCX enrollments stop/deny when the enforcement filter indicates a license limit is reached.
      • Instructor Dashboard Membership is hidden for non-admin staff on licensed CCXs.
  3. Enrollment email links

    • Trigger enrollment/invitation emails and confirm course_url points to the Learning MFE route.

Dependencies / related work

Reviewers

@anfbermudezme anfbermudezme force-pushed the vue/PADV-2726 branch 2 times, most recently from 019a044 to aef68aa Compare December 29, 2025 17:31
@anfbermudezme anfbermudezme changed the title feat: add license_enforcement filters. feat: add license_enforcement logic. Dec 30, 2025
@anfbermudezme anfbermudezme force-pushed the vue/PADV-2726 branch 2 times, most recently from c951f5e to 3898ed6 Compare December 30, 2025 18:09
@anfbermudezme anfbermudezme merged commit a8b7e15 into pearson/ulmo Jan 2, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants