Chore: Remove use of deprecated method in AC code (#87541)

* switch from using cfg to using featuremgmt for checking a feature toggle in AC code

* merge test fixes
This commit is contained in:
Ieva
2024-05-10 11:56:52 +01:00
committed by GitHub
parent 8c7b8542f1
commit 167151b211
39 changed files with 107 additions and 111 deletions
+4 -4
View File
@@ -129,7 +129,7 @@ func newTestLive(t *testing.T, store db.DB) *live.GrafanaLive {
nil,
&usagestats.UsageStatsMock{T: t},
nil,
features, acimpl.ProvideAccessControl(cfg), &dashboards.FakeDashboardService{}, annotationstest.NewFakeAnnotationsRepo(), nil)
features, acimpl.ProvideAccessControl(features), &dashboards.FakeDashboardService{}, annotationstest.NewFakeAnnotationsRepo(), nil)
require.NoError(t, err)
return gLive
}
@@ -146,7 +146,7 @@ func TestHTTPServer_GetDashboard_AccessControl(t *testing.T) {
hs.DashboardService = dashSvc
hs.Cfg = setting.NewCfg()
hs.AccessControl = acimpl.ProvideAccessControl(hs.Cfg)
hs.AccessControl = acimpl.ProvideAccessControl(featuremgmt.WithFeatures())
hs.starService = startest.NewStarServiceFake()
hs.dashboardProvisioningService = mockDashboardProvisioningService{}
@@ -265,7 +265,7 @@ func TestHTTPServer_DeleteDashboardByUID_AccessControl(t *testing.T) {
hs.DashboardService = dashSvc
hs.Cfg = setting.NewCfg()
hs.AccessControl = acimpl.ProvideAccessControl(hs.Cfg)
hs.AccessControl = acimpl.ProvideAccessControl(featuremgmt.WithFeatures())
hs.starService = startest.NewStarServiceFake()
hs.LibraryPanelService = &mockLibraryPanelService{}
@@ -321,7 +321,7 @@ func TestHTTPServer_GetDashboardVersions_AccessControl(t *testing.T) {
hs.DashboardService = dashSvc
hs.Cfg = setting.NewCfg()
hs.AccessControl = acimpl.ProvideAccessControl(hs.Cfg)
hs.AccessControl = acimpl.ProvideAccessControl(featuremgmt.WithFeatures())
hs.starService = startest.NewStarServiceFake()
hs.dashboardVersionService = &dashvertest.FakeDashboardVersionService{