[release-12.0.1] Access control: Make sure that user permission cache is cleared after new dashboard and folder creation (#104495)

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
This commit is contained in:
Stephanie Hingtgen
2025-04-24 15:48:04 -05:00
committed by GitHub
co-authored by Ieva
parent 26b81feb85
commit 123351e3ac
20 changed files with 99 additions and 90 deletions
-6
View File
@@ -536,12 +536,6 @@ func (hs *HTTPServer) postDashboard(c *contextmodel.ReqContext, cmd dashboards.S
return apierrors.ToDashboardErrorResponse(ctx, hs.pluginStore, saveErr)
}
// Clear permission cache for the user who's created the dashboard, so that new permissions are fetched for their next call
// Required for cases when caller wants to immediately interact with the newly created object
if newDashboard {
hs.accesscontrolService.ClearUserPermissionCache(c.SignedInUser)
}
// connect library panels for this dashboard after the dashboard is stored and has an ID
err = hs.LibraryPanelService.ConnectLibraryPanelsForDashboard(ctx, c.SignedInUser, dashboard)
if err != nil {