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:
@@ -12,8 +12,8 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/accesscontrol/acimpl"
|
||||
"github.com/grafana/grafana/pkg/services/contexthandler/ctxkey"
|
||||
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/services/user"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"github.com/grafana/grafana/pkg/web"
|
||||
)
|
||||
|
||||
@@ -25,8 +25,7 @@ type middlewareTestCase struct {
|
||||
}
|
||||
|
||||
func TestMiddleware(t *testing.T) {
|
||||
cfg := setting.NewCfg()
|
||||
ac := acimpl.ProvideAccessControl(cfg)
|
||||
ac := acimpl.ProvideAccessControl(featuremgmt.WithFeatures())
|
||||
|
||||
tests := []middlewareTestCase{
|
||||
{
|
||||
@@ -82,8 +81,7 @@ func TestMiddleware_forceLogin(t *testing.T) {
|
||||
{url: "/endpoint"},
|
||||
}
|
||||
|
||||
cfg := setting.NewCfg()
|
||||
ac := acimpl.ProvideAccessControl(cfg)
|
||||
ac := acimpl.ProvideAccessControl(featuremgmt.WithFeatures())
|
||||
|
||||
for _, tc := range tests {
|
||||
t.Run(tc.url, func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user