[v10.0.x] Folders: return an error when listing folders if permission guardian returns an error (#68224)

Folders: return an error when listing folders if permission guardian returns an error (#68109)

return an error when listing folders if perm gaurdian returns an error

(cherry picked from commit e51b92991d)

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
This commit is contained in:
Grot (@grafanabot)
2023-05-10 16:20:50 +03:00
committed by GitHub
co-authored by Ieva
parent e77a9c1269
commit cc2e352c03
+4 -1
View File
@@ -183,7 +183,10 @@ func (s *Service) GetChildren(ctx context.Context, cmd *folder.GetChildrenQuery)
return nil, err
}
canView, err := g.CanView()
if err != nil || canView {
if err != nil {
return nil, err
}
if canView {
// always expose the dashboard store sequential ID
f.ID = dashFolder.ID
filtered = append(filtered, f)