Chore: get user from appcontext rather than store utility (#59926)

user from appcontext
This commit is contained in:
Ryan McKinley
2022-12-07 07:38:23 -08:00
committed by GitHub
parent e8ed79873a
commit d036225f7b
9 changed files with 31 additions and 51 deletions
@@ -5,10 +5,10 @@ import (
"encoding/json"
"fmt"
"github.com/grafana/grafana/pkg/infra/appcontext"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/playlist"
"github.com/grafana/grafana/pkg/services/sqlstore/session"
objectstore "github.com/grafana/grafana/pkg/services/store"
"github.com/grafana/grafana/pkg/services/store/entity"
"github.com/grafana/grafana/pkg/services/user"
)
@@ -44,7 +44,7 @@ func (s *entityStoreImpl) sync() {
UserID: 0, // Admin user
IsGrafanaAdmin: true,
}
ctx := objectstore.ContextWithUser(context.Background(), rowUser)
ctx := appcontext.WithUser(context.Background(), rowUser)
for _, info := range results {
dto, err := s.sqlimpl.Get(ctx, &playlist.GetPlaylistByUidQuery{
OrgId: info.OrgID,