MCPcopy Create free account
hub / github.com/rilldata/rill / FeatureFlags

Method FeatureFlags

runtime/feature_flags.go:16–27  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
16func (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.
30var defaultFeatureFlags = map[string]string{

Callers 3

CheckAccessMethod · 0.80
checkDeveloperAccessFunction · 0.80
systemPromptMethod · 0.80

Calls 2

InstanceMethod · 0.95
ResolveFeatureFlagsFunction · 0.85

Tested by

no test coverage detected