[v11.1.x] RBAC: List only the folders that the user has access to (#89016)

RBAC: List only the folders that the user has access to (#88599)

only check folder permissions when listing folders

(cherry picked from commit 095ca66d9f)

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
This commit is contained in:
grafana-delivery-bot[bot]
2024-07-12 14:54:31 +03:00
committed by GitHub
co-authored by Ieva
parent c5ea48aec9
commit eab471a17c
-2
View File
@@ -347,10 +347,8 @@ func (s *Service) getRootFolders(ctx context.Context, q *folder.GetChildrenQuery
var folderPermissions []string
if q.Permission == dashboardaccess.PERMISSION_EDIT {
folderPermissions = permissions[dashboards.ActionFoldersWrite]
folderPermissions = append(folderPermissions, permissions[dashboards.ActionDashboardsWrite]...)
} else {
folderPermissions = permissions[dashboards.ActionFoldersRead]
folderPermissions = append(folderPermissions, permissions[dashboards.ActionDashboardsRead]...)
}
if len(folderPermissions) == 0 && !q.SignedInUser.GetIsGrafanaAdmin() {