Plugins: Account for nil user when constructing plugin context (#69811)

cater for nil user
This commit is contained in:
Will Browne
2023-06-08 18:36:41 +02:00
committed by GitHub
parent 9fc1de62d5
commit 91b0cdc871
4 changed files with 27 additions and 15 deletions

View File

@@ -74,7 +74,7 @@ func NewContextGetter(pluginContextProvider *plugincontext.Provider, dataSourceC
func (g *ContextGetter) GetPluginContext(ctx context.Context, user *user.SignedInUser, pluginID string, datasourceUID string, skipCache bool) (backend.PluginContext, error) {
if datasourceUID == "" {
return g.pluginContextProvider.Get(ctx, pluginID, user)
return g.pluginContextProvider.Get(ctx, pluginID, user, user.OrgID)
}
ds, err := g.dataSourceCache.GetDatasourceByUID(ctx, datasourceUID, user, skipCache)