Access control: Modify dashboard/folder resolvers so that return also the inherited scopes (#62025)

* Access Control: Add folder service dependency to the dashboard/folder resolvers

* Expose the function fetching parents to folder interface

* Add generic prepend utility

* Modify dashboard resolvers to return inherited scopes
This commit is contained in:
Sofia Papagiannaki
2023-01-26 10:21:10 +02:00
committed by GitHub
parent 8e3d22ca7a
commit cd27562c76
15 changed files with 276 additions and 35 deletions
+4
View File
@@ -40,6 +40,7 @@ import (
dashboardservice "github.com/grafana/grafana/pkg/services/dashboards/service"
dashver "github.com/grafana/grafana/pkg/services/dashboardversion"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/folder/foldertest"
"github.com/grafana/grafana/pkg/services/guardian"
"github.com/grafana/grafana/pkg/services/licensing"
"github.com/grafana/grafana/pkg/services/login"
@@ -392,6 +393,8 @@ func setupHTTPServerWithCfgDb(
folderPermissionsService := accesscontrolmock.NewMockedPermissionsService()
dashboardPermissionsService := accesscontrolmock.NewMockedPermissionsService()
folderSvc := foldertest.NewFakeService()
// Create minimal HTTP Server
hs := &HTTPServer{
Cfg: cfg,
@@ -408,6 +411,7 @@ func setupHTTPServerWithCfgDb(
DashboardService: dashboardservice.ProvideDashboardService(
cfg, dashboardsStore, dashboardsStore, nil, features,
folderPermissionsService, dashboardPermissionsService, ac,
folderSvc,
),
preferenceService: preftest.NewPreferenceServiceFake(),
userService: userSvc,