Extract search users functions into a service (#39002) (#39770)

* 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

(cherry picked from commit 02702eb82d)
This commit is contained in:
Selene
2021-09-29 17:02:58 +02:00
committed by GitHub
parent 4699620e23
commit d07ed05918
11 changed files with 139 additions and 69 deletions
+10 -6
View File
@@ -7,6 +7,8 @@ import (
"path/filepath"
"testing"
"github.com/grafana/grafana/pkg/services/searchusers"
"github.com/stretchr/testify/require"
"gopkg.in/macaron.v1"
@@ -206,13 +208,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)