def has_permission(self, request: Request, view: APIView) -> bool: assert hasattr( view, "premium_feature" ), "this permission class requires the `premium_feature` attribute to be set in the view." if not request.user or not request.user.organization: # type: ignore return True if view.premium_feature not in request.user.organization.available_features: # type: ignore raise EnterpriseFeatureException() return True
def update(self, property_definition: PropertyDefinition, validated_data): raise EnterpriseFeatureException()
def update(self, event_definition: EventDefinition, validated_data): raise EnterpriseFeatureException()