Files
mitai-jinkendo/backend
LarsandClaude Opus 4.6 c002cb1e54
Deploy Development / deploy (push) Successful in 55s
Build Test / lint-backend (push) Successful in 1s
Build Test / build-frontend (push) Has been cancelled
feat: add feature-access middleware for v9c subscription system
Implements flexible feature access control with 3-tier hierarchy:
1. User-specific restrictions (highest priority)
2. Tier limits
3. Feature defaults

New functions:
- get_effective_tier(profile_id) - Checks access_grants, falls back to profile.tier
- check_feature_access(profile_id, feature_id) - Complete access check
  Returns: {allowed, limit, used, remaining, reason}
- increment_feature_usage(profile_id, feature_id) - Usage tracking
- _calculate_next_reset(reset_period) - Helper for daily/monthly resets

Supports:
- Boolean features (enabled/disabled)
- Count-based features with limits
- Automatic reset (daily/monthly/never)
- Unlimited (NULL) and disabled (0) states

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 13:04:49 +01:00
..
2026-03-19 09:49:46 +01:00
9b
2026-03-18 08:27:33 +01:00