Changeset 0.37.19 (#232)

Co-authored-by: gobha <jasafpro@gmail.com>
Co-committed-by: gobha <jasafpro@gmail.com>
This commit is contained in:
2026-03-25 00:26:44 +00:00
committed by xcaliber
parent 54ceeb4299
commit be67feaa8e
21 changed files with 173 additions and 88 deletions

View File

@@ -108,13 +108,9 @@ type NotesPageData struct {
}
// SettingsPageData is what the settings surface templates receive.
// Feature gates (BYOK, personas) moved to sw.auth.policies in v0.37.19.
type SettingsPageData struct {
Section string `json:"section"`
// v0.22.7: Feature gates from admin config.
// These control which nav links/tabs are visible in the settings surface.
BYOKEnabled bool `json:"BYOKEnabled"`
UserPersonasEnabled bool `json:"UserPersonasEnabled"`
}
// ── Loader registration ──────────────────────
@@ -422,20 +418,7 @@ func (e *Engine) settingsLoader(c *gin.Context, s store.Stores) (any, error) {
section = "general"
}
data := &SettingsPageData{Section: section}
// Read feature gates from policies (where admin settings saves them).
// Keys: allow_user_byok, allow_user_personas
if s.Policies != nil {
ctx := context.Background()
policies, err := s.Policies.GetAll(ctx)
if err == nil {
data.BYOKEnabled = policies["allow_user_byok"] == "true"
data.UserPersonasEnabled = policies["allow_user_personas"] == "true"
}
}
return data, nil
return &SettingsPageData{Section: section}, nil
}
func (e *Engine) projectsLoader(c *gin.Context, s store.Stores) (any, error) {