Extract search users functions into a service (#39002)

* Extract search users to a new service

* Fix wire provider

* Fix common_test and remove RouteRegister

* Remove old endpoints

* Fix test

* Add indexes to dashboards and orgs tables

* Fix lint
This commit is contained in:
Selene
2021-09-29 12:51:49 +02:00
committed by GitHub
parent 0ecf13e5a3
commit 02702eb82d
12 changed files with 148 additions and 74 deletions

View File

@ -8,6 +8,8 @@ import (
"path/filepath"
"testing"
"github.com/grafana/grafana/pkg/services/searchusers"
"github.com/stretchr/testify/require"
"gopkg.in/macaron.v1"
@ -216,13 +218,15 @@ func setupAccessControlScenarioContext(t *testing.T, cfg *setting.Cfg, url strin
cfg.FeatureToggles["accesscontrol"] = true
cfg.Quota.Enabled = false
bus := bus.GetBus()
hs := &HTTPServer{
Cfg: cfg,
Bus: bus.GetBus(),
Live: newTestLive(t),
QuotaService: &quota.QuotaService{Cfg: cfg},
RouteRegister: routing.NewRouteRegister(),
AccessControl: accesscontrolmock.New().WithPermissions(permissions),
Cfg: cfg,
Bus: bus,
Live: newTestLive(t),
QuotaService: &quota.QuotaService{Cfg: cfg},
RouteRegister: routing.NewRouteRegister(),
AccessControl: accesscontrolmock.New().WithPermissions(permissions),
searchUsersService: searchusers.ProvideUsersService(bus),
}
sc := setupScenarioContext(t, url)