posthog
posthog copied to clipboard
fix(feature flags): Allow API to local evaluate feature flags with `Feature Flags Secure API key`
[!IMPORTANT] 👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Problem
Closes #33704
Changes
When calling the local evaluation endpoint with the Feature Flags Secure API key, the permission check was failing.
https://github.com/PostHog/posthog/blob/34f74870798a58964791a95785acca79a9fc4558/posthog/api/routing.py#L98-L117
The permission check that was failing is the ProjectSecretAPITokenPermission, and it was because the request.resolver_match.view_name was not in the list of values.
Did you write or update any docs for this change?
- [x] No docs needed for this change
How did you test this code?
Locally!