From d05ba80080e6fa436e68fd9d01a7fd22b2a32c88 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Thu, 4 May 2023 04:55:41 -0400 Subject: [PATCH] [v10.0.x] RBAC: Do not search for parents of the root folder (#67806) RBAC: Do not search for parents of the root folder (#67746) do not search for parents of the general folder (cherry picked from commit b1382ac48e890cb55ae963f749e6a2b4e5b0981e) Co-authored-by: Ieva --- pkg/services/dashboards/accesscontrol.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/services/dashboards/accesscontrol.go b/pkg/services/dashboards/accesscontrol.go index 2451fac0c81..3b798fddb4d 100644 --- a/pkg/services/dashboards/accesscontrol.go +++ b/pkg/services/dashboards/accesscontrol.go @@ -196,6 +196,9 @@ func resolveDashboardScope(ctx context.Context, folderDB folder.FolderStore, org } func GetInheritedScopes(ctx context.Context, orgID int64, folderUID string, folderSvc folder.Service) ([]string, error) { + if folderUID == ac.GeneralFolderUID { + return nil, nil + } ancestors, err := folderSvc.GetParents(ctx, folder.GetParentsQuery{ UID: folderUID, OrgID: orgID,