Chore: get user from appcontext rather than store utility (#59926)
user from appcontext
This commit is contained in:
@@ -6,9 +6,9 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/appcontext"
|
||||
"github.com/grafana/grafana/pkg/plugins"
|
||||
"github.com/grafana/grafana/pkg/services/datasources"
|
||||
"github.com/grafana/grafana/pkg/services/store"
|
||||
"github.com/grafana/grafana/pkg/tsdb/grafanads"
|
||||
)
|
||||
|
||||
@@ -122,9 +122,12 @@ func (c *dsCache) getDS(ctx context.Context, uid string) (*dsVal, error) {
|
||||
}
|
||||
}
|
||||
|
||||
orgID := store.UserFromContext(ctx).OrgID
|
||||
usr, err := appcontext.User(ctx)
|
||||
if err != nil {
|
||||
return nil, nil // no user
|
||||
}
|
||||
|
||||
v, ok := c.cache[orgID]
|
||||
v, ok := c.cache[usr.OrgID]
|
||||
if !ok {
|
||||
return nil, nil // org not found
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user