Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(rbac): add ACCESS_CONTROL to ENTERPRISE_FEATURES (#58812)

Alex Liderd87ac44f783d
diff --git a/ee/models/license.py b/ee/models/license.py
index b830224085ae..2221b256295e 100644
--- a/ee/models/license.py
+++ b/ee/models/license.py
@@ -74,6 +74,7 @@ class License(models.Model):
ENTERPRISE_FEATURES = [
*SCALE_FEATURES,
AvailableFeature.ADVANCED_PERMISSIONS,
+ AvailableFeature.ACCESS_CONTROL,
AvailableFeature.SAML,
AvailableFeature.SCIM,
AvailableFeature.SSO_ENFORCEMENT,
diff --git a/posthog/models/organization.py b/posthog/models/organization.py
index e17845949ec9..7062b064622f 100644
--- a/posthog/models/organization.py
+++ b/posthog/models/organization.py
@@ -74,11 +74,10 @@ class ProductFeature(TypedDict):
def _enterprise_only_feature_keys() -> frozenset[str]:
"""Enterprise-plan-only feature keys, computed once per process.
- Sourced from `License.ENTERPRISE_FEATURES - SCALE_FEATURES`, plus `ACCESS_CONTROL`
- (the successor to `ADVANCED_PERMISSIONS` per the `AvailableFeature` enum) which
- isn't reflected in `License.ENTERPRISE_FEATURES` yet but should classify the same way.
+ Sourced from `License.ENTERPRISE_FEATURES - SCALE_FEATURES`. Returns an empty
+ set when the ee package isn't importable.
"""
- keys: set[str] = {str(AvailableFeature.ACCESS_CONTROL)}
+ keys: set[str] = set()
try:
from ee.models.license import License
@@ -346,12 +345,10 @@ class Organization(ModelActivityMixin, UUIDTModel): # type: ignore[django-manag
"""Best-effort plan tier derived from `available_product_features`.
"enterprise" if any Enterprise-only feature is present (per `License.ENTERPRISE_FEATURES`
- minus `SCALE_FEATURES`, plus `access_control` — the successor to `advanced_permissions`
- per `AvailableFeature` in constants.py — which is not yet reflected in `License`).
- "paid" if any feature is present, otherwise "free". Paid uses "any feature present"
- rather than an allow-list because the billing service grants features (alerts,
- surveys_styling, ...) that postdate `License.SCALE_FEATURES`, and an allow-list
- silently downgrades those orgs to free.
+ minus `SCALE_FEATURES`). "paid" if any feature is present, otherwise "free". Paid uses
+ "any feature present" rather than an allow-list because the billing service grants
+ features (alerts, surveys_styling, ...) that postdate `License.SCALE_FEATURES`, and an
+ allow-list silently downgrades those orgs to free.
"""
available_keys = {
feature.get("key") for feature in (self.available_product_features or []) if feature and feature.get("key")