Feature Access Edge Case: Cozi Calendar Denied for FamilyCast Users
Resolved 💬 1 comment Opened Sep 29, 2025 by jduncan-rva Closed Sep 29, 2025
🐛 Bug Report: Feature Access Logic Issue
Problem
The Cozi Calendar integration is incorrectly showing as "allowed": false for FamilyCast users, when it should be "allowed": true based on the feature restriction configuration.
Expected Behavior
- FamilyCast users should have access to Cozi Calendar integration
- Feature access check should return
"allowed": trueforintegration:COZI_CALENDARwhenX-App-Type: familycast
Actual Behavior
- Both BrandCast AND FamilyCast users are denied access to Cozi Calendar
- API returns:
{"allowed": false, "reason": "Available in familycast only"}
Evidence from API Audit
Feature Restriction Configuration (from database seed):
{
featureKey: 'integration:COZI_CALENDAR',
featureType: FeatureType.INTEGRATION,
allowedProductLines: ['familycast'], // ✅ Correctly configured
displayName: 'Cozi Family Calendar',
description: 'Family-focused calendar integration',
upgradeMessage: 'Switch to FamilyCast to access family-oriented features'
}
API Test Results:
# FamilyCast context - SHOULD BE ALLOWED
curl -H "X-App-Type: familycast" \
-d '{"featureKeys": ["integration:COZI_CALENDAR"]}' \
/api/feature-restrictions/check
# Returns: {"allowed": false} ❌ INCORRECT
# BrandCast context - SHOULD BE DENIED
curl -H "X-App-Type: brandcast" \
-d '{"featureKeys": ["integration:COZI_CALENDAR"]}' \
/api/feature-restrictions/check
# Returns: {"allowed": false} ✅ CORRECT
Root Cause Analysis
Likely issues in the feature access logic:
- App context not being properly passed to feature gating service
- Product line resolution not working correctly for FamilyCast app type
- Feature access logic not properly checking
allowedProductLinesagainst current app context
Files to Investigate
apps/backend/src/services/featureGateService.ts- Feature access logicapps/backend/src/middleware/appContext.ts- App context detectionapps/backend/src/routes/featureRestrictions.ts- Feature restriction endpointspackages/shared-backend/src/types/featureGating.ts- Type definitions
Impact
- User Experience: FamilyCast users cannot access their intended family-focused integration
- Business Logic: Brand isolation is not working as designed for this feature
- Testing Gap: Need integration tests for feature access per brand
Severity
🟡 Medium - Specific feature affected, brand isolation compromised for one integration
Environment
- API Version: Current development
- Auth: Admin user testing
- Discovered during: Brand isolation audit
Next Steps
- Debug app context propagation in feature access checks
- Verify product line mapping (
familycaststring vsAppType.FAMILYCASTenum) - Add integration tests for brand-specific feature access
- Review other features with
allowedProductLinesfor similar issues
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗