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

@ -26,7 +26,7 @@ func (hs *HTTPServer) CallResource(c *contextmodel.ReqContext) {
}
func (hs *HTTPServer) callPluginResource(c *contextmodel.ReqContext, pluginID string) {
pCtx, err := hs.pluginContextProvider.Get(c.Req.Context(), pluginID, c.SignedInUser)
pCtx, err := hs.pluginContextProvider.Get(c.Req.Context(), pluginID, c.SignedInUser, c.OrgID)
if err != nil {
if errors.Is(err, plugincontext.ErrPluginNotFound) {
c.JsonApiErr(404, "Plugin not found", nil)