FeatureFlags finds and resolves the feature flags for the given instance ID and claims. It's designed for use in the backend. Use runtime.ResolveFeatureFlags for resolving flags that will be exposed to the UI.
(ctx context.Context, instanceID string, claims *SecurityClaims)
| 14 | // FeatureFlags finds and resolves the feature flags for the given instance ID and claims. |
| 15 | // It's designed for use in the backend. Use runtime.ResolveFeatureFlags for resolving flags that will be exposed to the UI. |
| 16 | func (r *Runtime) FeatureFlags(ctx context.Context, instanceID string, claims *SecurityClaims) (map[string]bool, error) { |
| 17 | inst, err := r.Instance(ctx, instanceID) |
| 18 | if err != nil { |
| 19 | return nil, err |
| 20 | } |
| 21 | |
| 22 | featureFlags, err := ResolveFeatureFlags(inst, claims.UserAttributes, false) |
| 23 | if err != nil { |
| 24 | return nil, err |
| 25 | } |
| 26 | return featureFlags, nil |
| 27 | } |
| 28 | |
| 29 | // defaultFeatureFlags contains the default feature flag rules. |
| 30 | var defaultFeatureFlags = map[string]string{ |
no test coverage detected