logs-at-sessionid #245

Merged
lash merged 3 commits from logs-at-sessionid into master 2025-01-04 08:56:10 +01:00
Showing only changes of commit 62f3681b9e - Show all commits

View File

@ -28,7 +28,7 @@ import (
) )
var ( var (
logg = logging.NewVanilla().WithDomain("ussdmenuhandler") logg = logging.NewVanilla().WithDomain("ussdmenuhandler").WithContextKey("session-id")
scriptDir = path.Join("services", "registration") scriptDir = path.Join("services", "registration")
translationDir = path.Join(scriptDir, "locale") translationDir = path.Join(scriptDir, "locale")
) )
@ -122,9 +122,12 @@ func (h *Handlers) Init(ctx context.Context, sym string, input []byte) (resource
h.st.Code = []byte{} h.st.Code = []byte{}
} }
sessionId, _ := ctx.Value("SessionId").(string) sessionId, ok := ctx.Value("SessionId").(string)
flag_admin_privilege, _ := h.flagManager.GetFlag("flag_admin_privilege") if ok {
context.WithValue(ctx, "session-id", sessionId)
}
flag_admin_privilege, _ := h.flagManager.GetFlag("flag_admin_privilege")
isAdmin, _ := h.adminstore.IsAdmin(sessionId) isAdmin, _ := h.adminstore.IsAdmin(sessionId)
if isAdmin { if isAdmin {