mirror of
https://github.com/grafana/grafana.git
synced 2025-09-21 03:12:53 +08:00
UserService: use the UserService instead of calling sqlstore directly (#55745)
* UserService: update callers to use the UserService instead of calling sqlstore directly There is one major change hiding in this PR. UserService.Delete originally called a number of services to delete user-related records. I moved everything except the actual call to the user table, and moved those into the API. This was done to avoid dependencies cycles; many of our services depend on the user service, so the user service itself should have as few dependencies as possible.
This commit is contained in:
@ -12,6 +12,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/accesscontrol"
|
||||
"github.com/grafana/grafana/pkg/services/org/orgimpl"
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore"
|
||||
"github.com/grafana/grafana/pkg/services/user/usertest"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
)
|
||||
|
||||
@ -198,7 +199,7 @@ func setupOrgsDBForAccessControlTests(t *testing.T, db sqlstore.Store, c accessC
|
||||
setInitCtxSignedInViewer(c.initCtx)
|
||||
u := *c.initCtx.SignedInUser
|
||||
u.OrgID = orgID
|
||||
c.usermock.ExpectedSignedInUser = &u
|
||||
c.userService.(*usertest.FakeUserService).ExpectedSignedInUser = &u
|
||||
|
||||
// Create `orgsCount` orgs
|
||||
for i := 1; i <= int(orgID); i++ {
|
||||
|
Reference in New Issue
Block a user