Changeset 0.25.4 (#164)
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user