Chore: Remove bus from admin users (#44869)

* Chore: Remove bus from admin users

* Mock authinfoservice

* Update user id

* attempt to fix the tests in admin users api

* fix type cast

* revert skipped tests

Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com>
This commit is contained in:
Kat YangandSerge Zaitsev authored and GitHub committed 2022-02-04 13:45:42 -05:00
1 parent ddfe2dce74
commit 7105bb3be7
6 files changed
+65 -63

No files matched your search

@@ -10,6 +10,7 @@ import (
type SQLStoreMock struct {
LastGetAlertsQuery *models.GetAlertsQuery
LatestUserId int64
ExpectedUser *models.User
ExpectedDatasource *models.DataSource
@@ -156,11 +157,17 @@ func (m *SQLStoreMock) GetSignedInUser(ctx context.Context, query *models.GetSig
return m.ExpectedError
}
func (m *SQLStoreMock) DisableUser(ctx context.Context, cmd *models.DisableUserCommand) error {
m.LatestUserId = cmd.UserId
return m.ExpectedError
}
func (m *SQLStoreMock) BatchDisableUsers(ctx context.Context, cmd *models.BatchDisableUsersCommand) error {
return m.ExpectedError
}
func (m *SQLStoreMock) DeleteUser(ctx context.Context, cmd *models.DeleteUserCommand) error {
m.LatestUserId = cmd.UserId
return m.ExpectedError
}
+1
View File
@@ -41,6 +41,7 @@ type Store interface {
GetUserOrgList(ctx context.Context, query *models.GetUserOrgListQuery) error
GetSignedInUserWithCacheCtx(ctx context.Context, query *models.GetSignedInUserQuery) error
GetSignedInUser(ctx context.Context, query *models.GetSignedInUserQuery) error
DisableUser(ctx context.Context, cmd *models.DisableUserCommand) error
BatchDisableUsers(ctx context.Context, cmd *models.BatchDisableUsersCommand) error
DeleteUser(ctx context.Context, cmd *models.DeleteUserCommand) error
UpdateUserPermissions(userID int64, isAdmin bool) error