Remove bus from datasource api (#44987)

* Remove bus from datasource api

* Add DatasourcePermissionService and use it in api

* Fix wire and rename

* Fix import in wire

* Fix bug

* Rename Service to OSS service

* Roll back fix
This commit is contained in:
idafurjes
2022-02-09 14:01:32 +01:00
committed by GitHub
parent 0282d5f9c3
commit df282a42cb
9 changed files with 273 additions and 252 deletions

View File

@@ -28,7 +28,9 @@ type SQLStoreMock struct {
ExpectedDashboardSnapshot *models.DashboardSnapshot
ExpectedTeamsByUser []*models.TeamDTO
ExpectedSearchOrgList []*models.OrgDTO
ExpectedError error
ExpectedDatasources []*models.DataSource
ExpectedError error
}
func NewSQLStoreMock() *SQLStoreMock {
@@ -483,6 +485,7 @@ func (m *SQLStoreMock) GetDataSource(ctx context.Context, query *models.GetDataS
}
func (m *SQLStoreMock) GetDataSources(ctx context.Context, query *models.GetDataSourcesQuery) error {
query.Result = m.ExpectedDatasources
return m.ExpectedError
}
@@ -499,10 +502,12 @@ func (m *SQLStoreMock) DeleteDataSource(ctx context.Context, cmd *models.DeleteD
}
func (m *SQLStoreMock) AddDataSource(ctx context.Context, cmd *models.AddDataSourceCommand) error {
cmd.Result = m.ExpectedDatasource
return m.ExpectedError
}
func (m *SQLStoreMock) UpdateDataSource(ctx context.Context, cmd *models.UpdateDataSourceCommand) error {
cmd.Result = m.ExpectedDatasource
return m.ExpectedError
}