From 4f873fe9de2f8d5369ea8b4ca6dd249818591233 Mon Sep 17 00:00:00 2001 From: Yared Yemane Date: Wed, 10 Jun 2026 04:44:18 -0700 Subject: [PATCH] chore: temporarily disable exam-prep subscription enforcement Add ExamPrepSubscriptionGateDisabled so learners can access exam-prep content without an IELTS or Duolingo plan. LMS subscription gating is unchanged. Co-authored-by: Cursor --- internal/domain/subscriptions.go | 3 +++ internal/web_server/handlers/content_access_gate.go | 8 ++++++++ internal/web_server/handlers/subscription_content_gate.go | 2 +- internal/web_server/middleware.go | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/internal/domain/subscriptions.go b/internal/domain/subscriptions.go index 192136c..22dd166 100644 --- a/internal/domain/subscriptions.go +++ b/internal/domain/subscriptions.go @@ -23,6 +23,9 @@ type SubscriptionExpiryReminder struct { // CategorySubscriptionGateDisabled skips subscription enforcement on learner-facing routes (temporary). var CategorySubscriptionGateDisabled = false +// ExamPrepSubscriptionGateDisabled skips IELTS/DUOLINGO subscription checks on exam-prep routes (temporary). +var ExamPrepSubscriptionGateDisabled = true + // IsLMSSubscriptionCategory reports plan categories that unlock Learn English (LMS) content. func IsLMSSubscriptionCategory(category string) bool { return normalizeSubscriptionCategory(category) == string(SubscriptionCategoryLearnEnglish) diff --git a/internal/web_server/handlers/content_access_gate.go b/internal/web_server/handlers/content_access_gate.go index c0f6a00..f03849a 100644 --- a/internal/web_server/handlers/content_access_gate.go +++ b/internal/web_server/handlers/content_access_gate.go @@ -93,6 +93,14 @@ func filterCoursesForLearner(items []domain.Course, program domain.Program, hasL } func filterExamPrepCatalogCoursesForLearner(items []domain.ExamPrepCatalogCourse, hasIELTS, hasDuolingo bool) []domain.ExamPrepCatalogCourse { + if domain.ExamPrepSubscriptionGateDisabled { + out := make([]domain.ExamPrepCatalogCourse, 0, len(items)) + for _, item := range items { + applyExamPrepCatalogCourseEffectiveAccessTier(&item) + out = append(out, item) + } + return out + } filtered := make([]domain.ExamPrepCatalogCourse, 0, len(items)) for _, item := range items { applyExamPrepCatalogCourseEffectiveAccessTier(&item) diff --git a/internal/web_server/handlers/subscription_content_gate.go b/internal/web_server/handlers/subscription_content_gate.go index 56df69a..19add86 100644 --- a/internal/web_server/handlers/subscription_content_gate.go +++ b/internal/web_server/handlers/subscription_content_gate.go @@ -16,7 +16,7 @@ func (h *Handler) learnerHasSubscriptionCategory(c *fiber.Ctx, category domain.S func (h *Handler) ensureLearnerExamPrepContentAccess(c *fiber.Ctx, contentCategory string, effectiveTier domain.ContentAccessTier) error { role, _ := c.Locals("role").(domain.Role) - if !role.IsCustomerLearnerRole() { + if !role.IsCustomerLearnerRole() || domain.ExamPrepSubscriptionGateDisabled { return nil } if !domain.IsExamPrepContentCategory(contentCategory) { diff --git a/internal/web_server/middleware.go b/internal/web_server/middleware.go index f2bd71f..dc46401 100644 --- a/internal/web_server/middleware.go +++ b/internal/web_server/middleware.go @@ -257,7 +257,7 @@ func (a *App) RequireExamPrepSubscription() fiber.Handler { if role != domain.RoleStudent && role != domain.RoleOpenLearner { return c.Next() } - if domain.CategorySubscriptionGateDisabled { + if domain.CategorySubscriptionGateDisabled || domain.ExamPrepSubscriptionGateDisabled { return c.Next() }