Modeling Feature Entitlements as an Ontology, Not a Pile of Boolean Flags

Most SaaS codebases enforce plan access with scattered if plan == 'pro' checks that quietly drift from what billing actually sells. Modeling entitlements as a small ontology, with typed Subjects, Resources, Conditions, and Decisions connected by explicit relations, turns access control into something queryable, auditable, and consistent across backend, billing, and UI.
Every SaaS product with more than one pricing tier eventually writes the same line of code: a conditional somewhere in the request path that checks whether the current customer's plan permits the feature they're trying to use. The first one is harmless. The hundredth one, scattered across the backend, a few frontend components, and an internal admin tool, is how plan access control quietly turns into the least-tested, least-understood part of the system.
Teams building that access-control layer into a SaaS product from scratch increasingly treat it as its own subsystem rather than an afterthought bolted onto billing webhooks. YuSMP Group's SaaS platform engineering team is one example of a dedicated partner teams bring in specifically for this kind of plan-tier access-control layer, because getting it wrong doesn't fail loudly. It fails as a slow accumulation of tickets from customers who can't tell if they're seeing a bug or a billing mismatch.
The fix isn't a smarter flag library. It's deciding, once, what an entitlement actually is as a typed concept, and letting every surface that checks access query the same model instead of re-implementing the check.
Why Boolean Flags Don't Scale as a SaaS Grows Plans
A single-tier product can get away with one boolean per feature. The moment a second plan tier ships, that boolean needs a condition attached: is the feature on for everyone, or only for Pro and above? A third tier, an add-on, and a usage-based limit later, that same conditional has grown into an unreadable chain of plan-name string comparisons duplicated across every place the feature is checked: the API route that serves the data, the frontend component that renders the button, and the admin dashboard that shows account status, each with its own slightly different version of the same check.
The failure mode that results has a name worth using precisely: entitlement drift. It happens when the plan definitions living in the billing system change, say a feature gets added to a lower tier or an add-on gets repriced, and the scattered boolean checks in application code aren't updated to match, because nothing forces them to be. Billing says the customer should have access. The code, still running its own stale copy of the logic, says they don't, or worse, grants access billing never approved. Neither side notices until a support ticket arrives.
What Is an Entitlement, Formally?
Common Core Ontologies gives a useful discipline for problems exactly like this: before modeling how something behaves, specify what kind of thing it is and what relates it to other things. Applied to entitlements, that means defining four typed classes instead of one overloaded boolean.
Subject: who is asking
The Subject is the entity requesting access: a user, an organization, or in machine-to-machine contexts a service account acting on an organization's behalf. Subjects aren't interchangeable: an organization-level entitlement and a per-seat entitlement are different relations even when they gate the same Resource, and collapsing them into one undifferentiated "current user" check is one of the more common sources of entitlement bugs in multi-seat products.
Resource: what is being gated
The Resource is whatever the access check protects: a feature, an API endpoint, a usage quota, or a whole module. A Resource should correspond to something the pricing page actually sells as a unit, not to an arbitrary code boundary that happens to be convenient to check.
Condition: under what terms
The Condition is the rule that connects a Subject's plan state to a Resource: plan tier at or above a threshold, an add-on purchased, or a usage counter under a limit. Conditions are exactly where plan definitions from billing get translated into something the ontology can evaluate, and they're the piece most responsible for entitlement drift when they go stale.
Decision: the result
The Decision is the evaluated outcome: allow, deny, or conditional-allow with specific constraints attached, such as access granted but capped at a usage ceiling. Decisions are what application code actually queries at request time. The backend doesn't re-derive the Condition logic on every call; it asks for the current Decision for a given Subject-Resource pair.
Framed this way, an entitlement check stops being a scattered conditional and becomes a query against a small, typed graph: find the Decision connecting this Subject to this Resource, given its current Conditions. The four classes don't need a reasoner or an OWL file to be useful. The value is in the discipline of keeping them separate, the same discipline a formal domain ontology enforces on any other entity model.
Where Does the Entitlement Layer Sit?
The practical architecture question is placement: where does Subject-Resource-Condition-Decision evaluation actually run? The answer that avoids drift is a single centralized entitlement layer sitting between the billing system and application logic, queried by every surface that needs an access decision, whether backend API, frontend, or admin tooling, rather than each surface independently reading plan state and re-deriving its own answer.
This is also where feature flags and entitlements need to be kept explicitly apart, even though both end up looking like a boolean at the call site. A feature flag answers "should this code path run right now," typically for a gradual rollout, and is meant to be short-lived. An entitlement answers "does this customer's plan permit this," is meant to persist for the life of the subscription, and is driven by what was sold, not by engineering rollout schedule. A flag library that also tries to carry plan-tier logic inherits none of the audit trail a billing-driven entitlement layer needs and all of the churn a rollout tool expects.
How Do Plan Upgrades Propagate in Real Time?
Plan upgrades propagate in real time by tying Decision cache invalidation directly to the billing webhook that confirms the plan change, not to a time-based TTL alone. A customer who upgrades mid-session expects the newly unlocked feature to appear without a page reload fixing it by accident, which requires the entitlement layer's Decisions to be invalidated the moment billing confirms the change rather than on the next scheduled cache refresh. A Decision cached for an hour after an upgrade is exactly the kind of staleness that generates a support ticket reading "I paid, why can't I use this yet," which is a worse outcome than a slightly slower uncached check on every request.
A Worked Example: From Plan Change to Feature Access
A customer on the Starter plan upgrades to Pro. The billing system processes the change and fires a webhook. The entitlement layer receives it and updates the Condition record linking that customer's Subject to the Pro tier threshold. Any cached Decision for that Subject against Pro-gated Resources, say an advanced-reporting module, is invalidated immediately rather than waiting out its TTL. The next request from that customer's session, whether it hits the backend API or renders a frontend component, queries the entitlement layer fresh, gets back an allow Decision for the reporting Resource, and the feature appears. No code path checked a plan-name string at any point. Every surface asked the same typed question of the same model and got a consistent answer.
Frequently Asked Questions
What's the difference between a feature flag and an entitlement?
A feature flag is a rollout mechanism: a switch an engineering team flips to ship a change to a subset of users, usually temporary and removed once the feature is fully released. An entitlement is a billing-driven access-control decision: whether a given customer's plan or add-on grants them a feature, permanently, for as long as they hold that plan. Conflating the two means rollout logic and plan logic end up sharing the same boolean, and nobody can safely remove either without checking the other.
Does an entitlement ontology replace my billing system?
No. Billing stays the source of truth for what a customer is paying for and which plan or add-ons they hold. The entitlement ontology sits downstream of billing and translates those commercial facts into Subject-Resource-Condition-Decision records that application code, APIs, and the UI can query consistently, instead of each surface re-deriving the same answer from raw billing data independently.
How granular should entitlement resources be?
Granular enough to match what you actually sell, no finer. If your pricing page lists a feature as one line item, model it as one Resource. Splitting a single sold feature into five fine-grained resources just to mirror internal code structure adds modeling overhead without adding anything a Condition or Decision needs to express.
What causes entitlement drift, and how do you catch it?
Drift happens when a plan definition changes in the billing system but the corresponding Condition in the entitlement model isn't updated to match, so the two sources of truth quietly disagree. Catching it is a matter of treating plan-to-entitlement mappings as data that gets validated, not code that gets trusted: a periodic reconciliation job that diffs billing's plan catalog against the ontology's Condition set will surface drift before a support ticket does.
Can this model support usage-based (metered) limits, not just on/off features?
Yes. A metered limit is still a Condition, just one with a numeric threshold instead of a plan name, for example current usage below the plan's monthly quota. The Decision becomes conditional-allow: access granted until the usage counter crosses the Condition's threshold, at which point the same Resource re-evaluates to deny or to a degraded-access variant, without changing the Subject or Resource definitions at all.
Where should entitlement decisions be enforced: frontend, backend, or both?
Both, but asymmetrically. The backend is the authoritative enforcement point and must check every Decision before granting access to a protected resource or endpoint, because frontend checks alone can always be bypassed. The frontend consumes the same Decision to hide or grey out UI it already knows will be denied, which is a UX improvement, not a security boundary.
Does this require a graph database, or does a relational schema work?
A relational schema works fine for most SaaS products. Subject, Resource, Condition, and Decision map cleanly onto a handful of tables with foreign keys between them, and SQL joins answer the "does this subject have this decision for this resource" query without difficulty. A graph database becomes worth the extra operational complexity only once the Condition relationships themselves form a deep hierarchy, such as nested organizations with add-ons inherited across sub-accounts, that relational joins start to struggle to traverse efficiently.
The Subject-Resource-Condition-Decision framing above maps closely onto attribute-based access control as formalized in NIST SP 800-162, which is a useful reference for teams who want the access-control terminology behind this model spelled out independently of any one vendor's implementation.
Keep reading

Ontology-Backed Data Models for Multi-Tenant SaaS Platforms
How a shared ontology keeps tenant data models consistent, queryable, and safe to evolve as a multi-tenant SaaS platform scales.

Building Knowledge Graphs with Common Core Ontologies
A step-by-step guide to modeling, ingesting, and validating a knowledge graph using CCO as the ontological schema layer.