Plan entitlements without the spaghetti

Gate features by plan tier using the same model you use for roles and permissions. No more scattered plan checks in business logic.

The scenario

Your product has Free, Pro, and Enterprise plans. Pro users get analytics and CSV export. Enterprise users get SSO and API access. You need to gate these features cleanly, and upgrading a customer should be instant.

Free
Basic
Pro
Analytics
CSV Export
Enterprise
SSO + API

The problem with hard-coded logic

Plan checks everywhere

Every feature has its own if (plan === 'pro') check buried in business logic.

Feature flags as access control

You're using feature flag tools to gate paid features, mixing deployment concerns with authorization.

Upgrades require deploys

Changing what a plan includes means updating code and redeploying.

No visibility

Support can't easily answer "does this customer have access to analytics?"

How Bailiff models it

Plans as groups

Model each plan tier as a group. Assign feature flags to the group. When a customer upgrades, move them to the new group. No code changes.

// Assign feature to Pro plan
await bailiff.assign('plan:pro', 'use', 'feature:analytics');

Check features like permissions

Use the same check() API for feature gates as you do for permissions. One pattern for everything.

const canExport = await bailiff.check(user, 'use', 'feature:csv_export');

Instant upgrades

Move a customer from plan:free to plan:pro via the API or dashboard. All gated features activate immediately.

Try it in the playground

The Workspace CRM scenario includes plan-based feature gating. Switch between Free and Pro users to see features appear and disappear.