Changeset 0.25.4 (#164)

This commit is contained in:
2026-03-09 20:17:46 +00:00
parent 2f7a0fb027
commit dbc1a97343
22 changed files with 660 additions and 491 deletions

View File

@@ -430,22 +430,14 @@ func (e *Engine) settingsLoader(c *gin.Context, s store.Stores) (any, error) {
data := &SettingsPageData{Section: section}
// Read feature gates from admin config
if s.GlobalConfig != nil {
// Read feature gates from policies (where admin settings saves them).
// Keys: allow_user_byok, allow_user_personas
if s.Policies != nil {
ctx := context.Background()
// BYOK: check if user providers are enabled
if raw, err := s.GlobalConfig.Get(ctx, "user_providers"); err == nil && raw != nil {
if v, ok := raw["enabled"].(bool); ok {
data.BYOKEnabled = v
}
}
// User Personas: check if user-created personas are enabled
if raw, err := s.GlobalConfig.Get(ctx, "user_personas"); err == nil && raw != nil {
if v, ok := raw["enabled"].(bool); ok {
data.UserPersonasEnabled = v
}
policies, err := s.Policies.GetAll(ctx)
if err == nil {
data.BYOKEnabled = policies["allow_user_byok"] == "true"
data.UserPersonasEnabled = policies["allow_user_personas"] == "true"
}
}