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
+2 -4
View File
@@ -18,12 +18,12 @@ import (
"github.com/grafana/grafana/pkg/login/social"
"github.com/grafana/grafana/pkg/services/accesscontrol"
"github.com/grafana/grafana/pkg/services/accesscontrol/acimpl"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/org"
"github.com/grafana/grafana/pkg/services/ssosettings"
"github.com/grafana/grafana/pkg/services/ssosettings/models"
"github.com/grafana/grafana/pkg/services/ssosettings/ssosettingstests"
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/web/webtest"
)
@@ -559,13 +559,11 @@ func getPermissionsForActionAndScope(action, scope string) map[int64]map[string]
func setupTests(t *testing.T, service ssosettings.Service) *webtest.Server {
t.Helper()
cfg := setting.NewCfg()
logger := log.NewNopLogger()
api := &Api{
Log: logger,
RouteRegister: routing.NewRouteRegister(),
AccessControl: acimpl.ProvideAccessControl(cfg),
AccessControl: acimpl.ProvideAccessControl(featuremgmt.WithFeatures()),
SSOSettingsService: service,
}