Folders: Validator: add temporary fix (#100019)

This commit is contained in:
Stephanie Hingtgen
2025-02-03 17:08:15 -06:00
committed by GitHub
parent 88c62cd828
commit 8ac9c47222
@@ -2,6 +2,7 @@ package ossaccesscontrol
import (
"context"
"errors"
"github.com/grafana/grafana/pkg/api/routing"
"github.com/grafana/grafana/pkg/apimachinery/identity"
@@ -106,6 +107,17 @@ func ProvideFolderPermissions(
})
if err != nil {
// if the folder is not found, this may be on the create path,
// where the write path to legacy will then go through the read
// path and try to read from both legacy & unified before it exists on both
if features.IsEnabledGlobally(featuremgmt.FlagKubernetesFoldersServiceV2) && errors.Is(err, dashboards.ErrFolderNotFound) {
_, err = folderService.GetLegacy(ctx, &folder.GetFolderQuery{
UID: &resourceID,
OrgID: orgID,
SignedInUser: ident,
})
return err
}
return err
}