mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
RBAC: remove unused dash and folder permission logic (#68968)
remove unused HasAdmin and HasEdit permission methods
This commit is contained in:
parent
4d74f75470
commit
9439649a4c
@ -16,20 +16,15 @@ import (
|
||||
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
|
||||
"github.com/grafana/grafana/pkg/services/dashboards"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/services/folder"
|
||||
"github.com/grafana/grafana/pkg/services/login"
|
||||
pref "github.com/grafana/grafana/pkg/services/preference"
|
||||
"github.com/grafana/grafana/pkg/services/user"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
)
|
||||
|
||||
// TODO this will be removed when we remove legacy AC fallback from HasAccess method
|
||||
func (hs *HTTPServer) editorInAnyFolder(c *contextmodel.ReqContext) bool {
|
||||
hasEditPermissionInFoldersQuery := folder.HasEditPermissionInFoldersQuery{SignedInUser: c.SignedInUser}
|
||||
hasEditPermissionInFoldersQueryResult, err := hs.DashboardService.HasEditPermissionInFolders(c.Req.Context(), &hasEditPermissionInFoldersQuery)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
return hasEditPermissionInFoldersQueryResult
|
||||
return false
|
||||
}
|
||||
|
||||
func (hs *HTTPServer) setIndexViewData(c *contextmodel.ReqContext) (*dtos.IndexViewData, error) {
|
||||
|
@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
|
||||
alertmodels "github.com/grafana/grafana/pkg/services/alerting/models"
|
||||
"github.com/grafana/grafana/pkg/services/folder"
|
||||
"github.com/grafana/grafana/pkg/services/quota"
|
||||
"github.com/grafana/grafana/pkg/services/search/model"
|
||||
"github.com/grafana/grafana/pkg/services/user"
|
||||
@ -22,8 +21,6 @@ type DashboardService interface {
|
||||
GetDashboards(ctx context.Context, query *GetDashboardsQuery) ([]*Dashboard, error)
|
||||
GetDashboardTags(ctx context.Context, query *GetDashboardTagsQuery) ([]*DashboardTagCloudItem, error)
|
||||
GetDashboardUIDByID(ctx context.Context, query *GetDashboardRefByIDQuery) (*DashboardRef, error)
|
||||
HasAdminPermissionInDashboardsOrFolders(ctx context.Context, query *folder.HasAdminPermissionInDashboardsOrFoldersQuery) (bool, error)
|
||||
HasEditPermissionInFolders(ctx context.Context, query *folder.HasEditPermissionInFoldersQuery) (bool, error)
|
||||
ImportDashboard(ctx context.Context, dto *SaveDashboardDTO) (*Dashboard, error)
|
||||
MakeUserAdmin(ctx context.Context, orgID int64, userID, dashboardID int64, setViewAndEditPermissions bool) error
|
||||
SaveDashboard(ctx context.Context, dto *SaveDashboardDTO, allowUiUpdate bool) (*Dashboard, error)
|
||||
@ -69,8 +66,6 @@ type Store interface {
|
||||
GetProvisionedDashboardData(ctx context.Context, name string) ([]*DashboardProvisioning, error)
|
||||
GetProvisionedDataByDashboardID(ctx context.Context, dashboardID int64) (*DashboardProvisioning, error)
|
||||
GetProvisionedDataByDashboardUID(ctx context.Context, orgID int64, dashboardUID string) (*DashboardProvisioning, error)
|
||||
HasAdminPermissionInDashboardsOrFolders(ctx context.Context, query *folder.HasAdminPermissionInDashboardsOrFoldersQuery) (bool, error)
|
||||
HasEditPermissionInFolders(ctx context.Context, query *folder.HasEditPermissionInFoldersQuery) (bool, error)
|
||||
// SaveAlerts saves dashboard alerts.
|
||||
SaveAlerts(ctx context.Context, dashID int64, alerts []*alertmodels.Alert) error
|
||||
SaveDashboard(ctx context.Context, cmd SaveDashboardCommand) (*Dashboard, error)
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Code generated by mockery v2.16.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.28.0. DO NOT EDIT.
|
||||
|
||||
package dashboards
|
||||
|
||||
@ -46,6 +46,10 @@ func (_m *FakeDashboardProvisioning) GetProvisionedDashboardData(ctx context.Con
|
||||
ret := _m.Called(ctx, name)
|
||||
|
||||
var r0 []*DashboardProvisioning
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) ([]*DashboardProvisioning, error)); ok {
|
||||
return rf(ctx, name)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) []*DashboardProvisioning); ok {
|
||||
r0 = rf(ctx, name)
|
||||
} else {
|
||||
@ -54,7 +58,6 @@ func (_m *FakeDashboardProvisioning) GetProvisionedDashboardData(ctx context.Con
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
||||
r1 = rf(ctx, name)
|
||||
} else {
|
||||
@ -69,6 +72,10 @@ func (_m *FakeDashboardProvisioning) GetProvisionedDashboardDataByDashboardID(ct
|
||||
ret := _m.Called(ctx, dashboardID)
|
||||
|
||||
var r0 *DashboardProvisioning
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, int64) (*DashboardProvisioning, error)); ok {
|
||||
return rf(ctx, dashboardID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, int64) *DashboardProvisioning); ok {
|
||||
r0 = rf(ctx, dashboardID)
|
||||
} else {
|
||||
@ -77,7 +84,6 @@ func (_m *FakeDashboardProvisioning) GetProvisionedDashboardDataByDashboardID(ct
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok {
|
||||
r1 = rf(ctx, dashboardID)
|
||||
} else {
|
||||
@ -92,6 +98,10 @@ func (_m *FakeDashboardProvisioning) GetProvisionedDashboardDataByDashboardUID(c
|
||||
ret := _m.Called(ctx, orgID, dashboardUID)
|
||||
|
||||
var r0 *DashboardProvisioning
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, int64, string) (*DashboardProvisioning, error)); ok {
|
||||
return rf(ctx, orgID, dashboardUID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, int64, string) *DashboardProvisioning); ok {
|
||||
r0 = rf(ctx, orgID, dashboardUID)
|
||||
} else {
|
||||
@ -100,7 +110,6 @@ func (_m *FakeDashboardProvisioning) GetProvisionedDashboardDataByDashboardUID(c
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(context.Context, int64, string) error); ok {
|
||||
r1 = rf(ctx, orgID, dashboardUID)
|
||||
} else {
|
||||
@ -115,6 +124,10 @@ func (_m *FakeDashboardProvisioning) SaveFolderForProvisionedDashboards(_a0 cont
|
||||
ret := _m.Called(_a0, _a1)
|
||||
|
||||
var r0 *Dashboard
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *SaveDashboardDTO) (*Dashboard, error)); ok {
|
||||
return rf(_a0, _a1)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *SaveDashboardDTO) *Dashboard); ok {
|
||||
r0 = rf(_a0, _a1)
|
||||
} else {
|
||||
@ -123,7 +136,6 @@ func (_m *FakeDashboardProvisioning) SaveFolderForProvisionedDashboards(_a0 cont
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *SaveDashboardDTO) error); ok {
|
||||
r1 = rf(_a0, _a1)
|
||||
} else {
|
||||
@ -138,6 +150,10 @@ func (_m *FakeDashboardProvisioning) SaveProvisionedDashboard(ctx context.Contex
|
||||
ret := _m.Called(ctx, dto, provisioning)
|
||||
|
||||
var r0 *Dashboard
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *SaveDashboardDTO, *DashboardProvisioning) (*Dashboard, error)); ok {
|
||||
return rf(ctx, dto, provisioning)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *SaveDashboardDTO, *DashboardProvisioning) *Dashboard); ok {
|
||||
r0 = rf(ctx, dto, provisioning)
|
||||
} else {
|
||||
@ -146,7 +162,6 @@ func (_m *FakeDashboardProvisioning) SaveProvisionedDashboard(ctx context.Contex
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *SaveDashboardDTO, *DashboardProvisioning) error); ok {
|
||||
r1 = rf(ctx, dto, provisioning)
|
||||
} else {
|
||||
|
@ -1,14 +1,12 @@
|
||||
// Code generated by mockery v2.23.2. DO NOT EDIT.
|
||||
// Code generated by mockery v2.28.0. DO NOT EDIT.
|
||||
|
||||
package dashboards
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
folder "github.com/grafana/grafana/pkg/services/folder"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
model "github.com/grafana/grafana/pkg/services/search/model"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
user "github.com/grafana/grafana/pkg/services/user"
|
||||
)
|
||||
@ -18,14 +16,6 @@ type FakeDashboardService struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
type FakeDashboardService_Expecter struct {
|
||||
mock *mock.Mock
|
||||
}
|
||||
|
||||
func (_m *FakeDashboardService) EXPECT() *FakeDashboardService_Expecter {
|
||||
return &FakeDashboardService_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// BuildSaveDashboardCommand provides a mock function with given fields: ctx, dto, shouldValidateAlerts, validateProvisionedDashboard
|
||||
func (_m *FakeDashboardService) BuildSaveDashboardCommand(ctx context.Context, dto *SaveDashboardDTO, shouldValidateAlerts bool, validateProvisionedDashboard bool) (*SaveDashboardCommand, error) {
|
||||
ret := _m.Called(ctx, dto, shouldValidateAlerts, validateProvisionedDashboard)
|
||||
@ -52,37 +42,6 @@ func (_m *FakeDashboardService) BuildSaveDashboardCommand(ctx context.Context, d
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardService_BuildSaveDashboardCommand_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BuildSaveDashboardCommand'
|
||||
type FakeDashboardService_BuildSaveDashboardCommand_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// BuildSaveDashboardCommand is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - dto *SaveDashboardDTO
|
||||
// - shouldValidateAlerts bool
|
||||
// - validateProvisionedDashboard bool
|
||||
func (_e *FakeDashboardService_Expecter) BuildSaveDashboardCommand(ctx interface{}, dto interface{}, shouldValidateAlerts interface{}, validateProvisionedDashboard interface{}) *FakeDashboardService_BuildSaveDashboardCommand_Call {
|
||||
return &FakeDashboardService_BuildSaveDashboardCommand_Call{Call: _e.mock.On("BuildSaveDashboardCommand", ctx, dto, shouldValidateAlerts, validateProvisionedDashboard)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_BuildSaveDashboardCommand_Call) Run(run func(ctx context.Context, dto *SaveDashboardDTO, shouldValidateAlerts bool, validateProvisionedDashboard bool)) *FakeDashboardService_BuildSaveDashboardCommand_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*SaveDashboardDTO), args[2].(bool), args[3].(bool))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_BuildSaveDashboardCommand_Call) Return(_a0 *SaveDashboardCommand, _a1 error) *FakeDashboardService_BuildSaveDashboardCommand_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_BuildSaveDashboardCommand_Call) RunAndReturn(run func(context.Context, *SaveDashboardDTO, bool, bool) (*SaveDashboardCommand, error)) *FakeDashboardService_BuildSaveDashboardCommand_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// CountInFolder provides a mock function with given fields: ctx, orgID, uid, _a3
|
||||
func (_m *FakeDashboardService) CountInFolder(ctx context.Context, orgID int64, uid string, _a3 *user.SignedInUser) (int64, error) {
|
||||
ret := _m.Called(ctx, orgID, uid, _a3)
|
||||
@ -107,37 +66,6 @@ func (_m *FakeDashboardService) CountInFolder(ctx context.Context, orgID int64,
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardService_CountInFolder_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountInFolder'
|
||||
type FakeDashboardService_CountInFolder_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// CountInFolder is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - orgID int64
|
||||
// - uid string
|
||||
// - _a3 *user.SignedInUser
|
||||
func (_e *FakeDashboardService_Expecter) CountInFolder(ctx interface{}, orgID interface{}, uid interface{}, _a3 interface{}) *FakeDashboardService_CountInFolder_Call {
|
||||
return &FakeDashboardService_CountInFolder_Call{Call: _e.mock.On("CountInFolder", ctx, orgID, uid, _a3)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_CountInFolder_Call) Run(run func(ctx context.Context, orgID int64, uid string, _a3 *user.SignedInUser)) *FakeDashboardService_CountInFolder_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(int64), args[2].(string), args[3].(*user.SignedInUser))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_CountInFolder_Call) Return(_a0 int64, _a1 error) *FakeDashboardService_CountInFolder_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_CountInFolder_Call) RunAndReturn(run func(context.Context, int64, string, *user.SignedInUser) (int64, error)) *FakeDashboardService_CountInFolder_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// DeleteACLByUser provides a mock function with given fields: ctx, userID
|
||||
func (_m *FakeDashboardService) DeleteACLByUser(ctx context.Context, userID int64) error {
|
||||
ret := _m.Called(ctx, userID)
|
||||
@ -152,35 +80,6 @@ func (_m *FakeDashboardService) DeleteACLByUser(ctx context.Context, userID int6
|
||||
return r0
|
||||
}
|
||||
|
||||
// FakeDashboardService_DeleteACLByUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteACLByUser'
|
||||
type FakeDashboardService_DeleteACLByUser_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// DeleteACLByUser is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - userID int64
|
||||
func (_e *FakeDashboardService_Expecter) DeleteACLByUser(ctx interface{}, userID interface{}) *FakeDashboardService_DeleteACLByUser_Call {
|
||||
return &FakeDashboardService_DeleteACLByUser_Call{Call: _e.mock.On("DeleteACLByUser", ctx, userID)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_DeleteACLByUser_Call) Run(run func(ctx context.Context, userID int64)) *FakeDashboardService_DeleteACLByUser_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(int64))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_DeleteACLByUser_Call) Return(_a0 error) *FakeDashboardService_DeleteACLByUser_Call {
|
||||
_c.Call.Return(_a0)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_DeleteACLByUser_Call) RunAndReturn(run func(context.Context, int64) error) *FakeDashboardService_DeleteACLByUser_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// DeleteDashboard provides a mock function with given fields: ctx, dashboardId, orgId
|
||||
func (_m *FakeDashboardService) DeleteDashboard(ctx context.Context, dashboardId int64, orgId int64) error {
|
||||
ret := _m.Called(ctx, dashboardId, orgId)
|
||||
@ -195,36 +94,6 @@ func (_m *FakeDashboardService) DeleteDashboard(ctx context.Context, dashboardId
|
||||
return r0
|
||||
}
|
||||
|
||||
// FakeDashboardService_DeleteDashboard_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteDashboard'
|
||||
type FakeDashboardService_DeleteDashboard_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// DeleteDashboard is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - dashboardId int64
|
||||
// - orgId int64
|
||||
func (_e *FakeDashboardService_Expecter) DeleteDashboard(ctx interface{}, dashboardId interface{}, orgId interface{}) *FakeDashboardService_DeleteDashboard_Call {
|
||||
return &FakeDashboardService_DeleteDashboard_Call{Call: _e.mock.On("DeleteDashboard", ctx, dashboardId, orgId)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_DeleteDashboard_Call) Run(run func(ctx context.Context, dashboardId int64, orgId int64)) *FakeDashboardService_DeleteDashboard_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(int64), args[2].(int64))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_DeleteDashboard_Call) Return(_a0 error) *FakeDashboardService_DeleteDashboard_Call {
|
||||
_c.Call.Return(_a0)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_DeleteDashboard_Call) RunAndReturn(run func(context.Context, int64, int64) error) *FakeDashboardService_DeleteDashboard_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// FindDashboards provides a mock function with given fields: ctx, query
|
||||
func (_m *FakeDashboardService) FindDashboards(ctx context.Context, query *FindPersistedDashboardsQuery) ([]DashboardSearchProjection, error) {
|
||||
ret := _m.Called(ctx, query)
|
||||
@ -251,35 +120,6 @@ func (_m *FakeDashboardService) FindDashboards(ctx context.Context, query *FindP
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardService_FindDashboards_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindDashboards'
|
||||
type FakeDashboardService_FindDashboards_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// FindDashboards is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - query *FindPersistedDashboardsQuery
|
||||
func (_e *FakeDashboardService_Expecter) FindDashboards(ctx interface{}, query interface{}) *FakeDashboardService_FindDashboards_Call {
|
||||
return &FakeDashboardService_FindDashboards_Call{Call: _e.mock.On("FindDashboards", ctx, query)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_FindDashboards_Call) Run(run func(ctx context.Context, query *FindPersistedDashboardsQuery)) *FakeDashboardService_FindDashboards_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*FindPersistedDashboardsQuery))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_FindDashboards_Call) Return(_a0 []DashboardSearchProjection, _a1 error) *FakeDashboardService_FindDashboards_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_FindDashboards_Call) RunAndReturn(run func(context.Context, *FindPersistedDashboardsQuery) ([]DashboardSearchProjection, error)) *FakeDashboardService_FindDashboards_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetDashboard provides a mock function with given fields: ctx, query
|
||||
func (_m *FakeDashboardService) GetDashboard(ctx context.Context, query *GetDashboardQuery) (*Dashboard, error) {
|
||||
ret := _m.Called(ctx, query)
|
||||
@ -306,35 +146,6 @@ func (_m *FakeDashboardService) GetDashboard(ctx context.Context, query *GetDash
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardService_GetDashboard_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDashboard'
|
||||
type FakeDashboardService_GetDashboard_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetDashboard is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - query *GetDashboardQuery
|
||||
func (_e *FakeDashboardService_Expecter) GetDashboard(ctx interface{}, query interface{}) *FakeDashboardService_GetDashboard_Call {
|
||||
return &FakeDashboardService_GetDashboard_Call{Call: _e.mock.On("GetDashboard", ctx, query)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_GetDashboard_Call) Run(run func(ctx context.Context, query *GetDashboardQuery)) *FakeDashboardService_GetDashboard_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*GetDashboardQuery))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_GetDashboard_Call) Return(_a0 *Dashboard, _a1 error) *FakeDashboardService_GetDashboard_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_GetDashboard_Call) RunAndReturn(run func(context.Context, *GetDashboardQuery) (*Dashboard, error)) *FakeDashboardService_GetDashboard_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetDashboardACLInfoList provides a mock function with given fields: ctx, query
|
||||
func (_m *FakeDashboardService) GetDashboardACLInfoList(ctx context.Context, query *GetDashboardACLInfoListQuery) ([]*DashboardACLInfoDTO, error) {
|
||||
ret := _m.Called(ctx, query)
|
||||
@ -361,35 +172,6 @@ func (_m *FakeDashboardService) GetDashboardACLInfoList(ctx context.Context, que
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardService_GetDashboardACLInfoList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDashboardACLInfoList'
|
||||
type FakeDashboardService_GetDashboardACLInfoList_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetDashboardACLInfoList is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - query *GetDashboardACLInfoListQuery
|
||||
func (_e *FakeDashboardService_Expecter) GetDashboardACLInfoList(ctx interface{}, query interface{}) *FakeDashboardService_GetDashboardACLInfoList_Call {
|
||||
return &FakeDashboardService_GetDashboardACLInfoList_Call{Call: _e.mock.On("GetDashboardACLInfoList", ctx, query)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_GetDashboardACLInfoList_Call) Run(run func(ctx context.Context, query *GetDashboardACLInfoListQuery)) *FakeDashboardService_GetDashboardACLInfoList_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*GetDashboardACLInfoListQuery))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_GetDashboardACLInfoList_Call) Return(_a0 []*DashboardACLInfoDTO, _a1 error) *FakeDashboardService_GetDashboardACLInfoList_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_GetDashboardACLInfoList_Call) RunAndReturn(run func(context.Context, *GetDashboardACLInfoListQuery) ([]*DashboardACLInfoDTO, error)) *FakeDashboardService_GetDashboardACLInfoList_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetDashboardTags provides a mock function with given fields: ctx, query
|
||||
func (_m *FakeDashboardService) GetDashboardTags(ctx context.Context, query *GetDashboardTagsQuery) ([]*DashboardTagCloudItem, error) {
|
||||
ret := _m.Called(ctx, query)
|
||||
@ -416,35 +198,6 @@ func (_m *FakeDashboardService) GetDashboardTags(ctx context.Context, query *Get
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardService_GetDashboardTags_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDashboardTags'
|
||||
type FakeDashboardService_GetDashboardTags_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetDashboardTags is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - query *GetDashboardTagsQuery
|
||||
func (_e *FakeDashboardService_Expecter) GetDashboardTags(ctx interface{}, query interface{}) *FakeDashboardService_GetDashboardTags_Call {
|
||||
return &FakeDashboardService_GetDashboardTags_Call{Call: _e.mock.On("GetDashboardTags", ctx, query)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_GetDashboardTags_Call) Run(run func(ctx context.Context, query *GetDashboardTagsQuery)) *FakeDashboardService_GetDashboardTags_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*GetDashboardTagsQuery))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_GetDashboardTags_Call) Return(_a0 []*DashboardTagCloudItem, _a1 error) *FakeDashboardService_GetDashboardTags_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_GetDashboardTags_Call) RunAndReturn(run func(context.Context, *GetDashboardTagsQuery) ([]*DashboardTagCloudItem, error)) *FakeDashboardService_GetDashboardTags_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetDashboardUIDByID provides a mock function with given fields: ctx, query
|
||||
func (_m *FakeDashboardService) GetDashboardUIDByID(ctx context.Context, query *GetDashboardRefByIDQuery) (*DashboardRef, error) {
|
||||
ret := _m.Called(ctx, query)
|
||||
@ -471,35 +224,6 @@ func (_m *FakeDashboardService) GetDashboardUIDByID(ctx context.Context, query *
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardService_GetDashboardUIDByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDashboardUIDByID'
|
||||
type FakeDashboardService_GetDashboardUIDByID_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetDashboardUIDByID is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - query *GetDashboardRefByIDQuery
|
||||
func (_e *FakeDashboardService_Expecter) GetDashboardUIDByID(ctx interface{}, query interface{}) *FakeDashboardService_GetDashboardUIDByID_Call {
|
||||
return &FakeDashboardService_GetDashboardUIDByID_Call{Call: _e.mock.On("GetDashboardUIDByID", ctx, query)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_GetDashboardUIDByID_Call) Run(run func(ctx context.Context, query *GetDashboardRefByIDQuery)) *FakeDashboardService_GetDashboardUIDByID_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*GetDashboardRefByIDQuery))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_GetDashboardUIDByID_Call) Return(_a0 *DashboardRef, _a1 error) *FakeDashboardService_GetDashboardUIDByID_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_GetDashboardUIDByID_Call) RunAndReturn(run func(context.Context, *GetDashboardRefByIDQuery) (*DashboardRef, error)) *FakeDashboardService_GetDashboardUIDByID_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetDashboards provides a mock function with given fields: ctx, query
|
||||
func (_m *FakeDashboardService) GetDashboards(ctx context.Context, query *GetDashboardsQuery) ([]*Dashboard, error) {
|
||||
ret := _m.Called(ctx, query)
|
||||
@ -526,141 +250,6 @@ func (_m *FakeDashboardService) GetDashboards(ctx context.Context, query *GetDas
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardService_GetDashboards_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDashboards'
|
||||
type FakeDashboardService_GetDashboards_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetDashboards is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - query *GetDashboardsQuery
|
||||
func (_e *FakeDashboardService_Expecter) GetDashboards(ctx interface{}, query interface{}) *FakeDashboardService_GetDashboards_Call {
|
||||
return &FakeDashboardService_GetDashboards_Call{Call: _e.mock.On("GetDashboards", ctx, query)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_GetDashboards_Call) Run(run func(ctx context.Context, query *GetDashboardsQuery)) *FakeDashboardService_GetDashboards_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*GetDashboardsQuery))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_GetDashboards_Call) Return(_a0 []*Dashboard, _a1 error) *FakeDashboardService_GetDashboards_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_GetDashboards_Call) RunAndReturn(run func(context.Context, *GetDashboardsQuery) ([]*Dashboard, error)) *FakeDashboardService_GetDashboards_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// HasAdminPermissionInDashboardsOrFolders provides a mock function with given fields: ctx, query
|
||||
func (_m *FakeDashboardService) HasAdminPermissionInDashboardsOrFolders(ctx context.Context, query *folder.HasAdminPermissionInDashboardsOrFoldersQuery) (bool, error) {
|
||||
ret := _m.Called(ctx, query)
|
||||
|
||||
var r0 bool
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *folder.HasAdminPermissionInDashboardsOrFoldersQuery) (bool, error)); ok {
|
||||
return rf(ctx, query)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *folder.HasAdminPermissionInDashboardsOrFoldersQuery) bool); ok {
|
||||
r0 = rf(ctx, query)
|
||||
} else {
|
||||
r0 = ret.Get(0).(bool)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *folder.HasAdminPermissionInDashboardsOrFoldersQuery) error); ok {
|
||||
r1 = rf(ctx, query)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardService_HasAdminPermissionInDashboardsOrFolders_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasAdminPermissionInDashboardsOrFolders'
|
||||
type FakeDashboardService_HasAdminPermissionInDashboardsOrFolders_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// HasAdminPermissionInDashboardsOrFolders is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - query *folder.HasAdminPermissionInDashboardsOrFoldersQuery
|
||||
func (_e *FakeDashboardService_Expecter) HasAdminPermissionInDashboardsOrFolders(ctx interface{}, query interface{}) *FakeDashboardService_HasAdminPermissionInDashboardsOrFolders_Call {
|
||||
return &FakeDashboardService_HasAdminPermissionInDashboardsOrFolders_Call{Call: _e.mock.On("HasAdminPermissionInDashboardsOrFolders", ctx, query)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_HasAdminPermissionInDashboardsOrFolders_Call) Run(run func(ctx context.Context, query *folder.HasAdminPermissionInDashboardsOrFoldersQuery)) *FakeDashboardService_HasAdminPermissionInDashboardsOrFolders_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*folder.HasAdminPermissionInDashboardsOrFoldersQuery))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_HasAdminPermissionInDashboardsOrFolders_Call) Return(_a0 bool, _a1 error) *FakeDashboardService_HasAdminPermissionInDashboardsOrFolders_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_HasAdminPermissionInDashboardsOrFolders_Call) RunAndReturn(run func(context.Context, *folder.HasAdminPermissionInDashboardsOrFoldersQuery) (bool, error)) *FakeDashboardService_HasAdminPermissionInDashboardsOrFolders_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// HasEditPermissionInFolders provides a mock function with given fields: ctx, query
|
||||
func (_m *FakeDashboardService) HasEditPermissionInFolders(ctx context.Context, query *folder.HasEditPermissionInFoldersQuery) (bool, error) {
|
||||
ret := _m.Called(ctx, query)
|
||||
|
||||
var r0 bool
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *folder.HasEditPermissionInFoldersQuery) (bool, error)); ok {
|
||||
return rf(ctx, query)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *folder.HasEditPermissionInFoldersQuery) bool); ok {
|
||||
r0 = rf(ctx, query)
|
||||
} else {
|
||||
r0 = ret.Get(0).(bool)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *folder.HasEditPermissionInFoldersQuery) error); ok {
|
||||
r1 = rf(ctx, query)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardService_HasEditPermissionInFolders_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasEditPermissionInFolders'
|
||||
type FakeDashboardService_HasEditPermissionInFolders_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// HasEditPermissionInFolders is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - query *folder.HasEditPermissionInFoldersQuery
|
||||
func (_e *FakeDashboardService_Expecter) HasEditPermissionInFolders(ctx interface{}, query interface{}) *FakeDashboardService_HasEditPermissionInFolders_Call {
|
||||
return &FakeDashboardService_HasEditPermissionInFolders_Call{Call: _e.mock.On("HasEditPermissionInFolders", ctx, query)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_HasEditPermissionInFolders_Call) Run(run func(ctx context.Context, query *folder.HasEditPermissionInFoldersQuery)) *FakeDashboardService_HasEditPermissionInFolders_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*folder.HasEditPermissionInFoldersQuery))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_HasEditPermissionInFolders_Call) Return(_a0 bool, _a1 error) *FakeDashboardService_HasEditPermissionInFolders_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_HasEditPermissionInFolders_Call) RunAndReturn(run func(context.Context, *folder.HasEditPermissionInFoldersQuery) (bool, error)) *FakeDashboardService_HasEditPermissionInFolders_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ImportDashboard provides a mock function with given fields: ctx, dto
|
||||
func (_m *FakeDashboardService) ImportDashboard(ctx context.Context, dto *SaveDashboardDTO) (*Dashboard, error) {
|
||||
ret := _m.Called(ctx, dto)
|
||||
@ -687,35 +276,6 @@ func (_m *FakeDashboardService) ImportDashboard(ctx context.Context, dto *SaveDa
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardService_ImportDashboard_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImportDashboard'
|
||||
type FakeDashboardService_ImportDashboard_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// ImportDashboard is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - dto *SaveDashboardDTO
|
||||
func (_e *FakeDashboardService_Expecter) ImportDashboard(ctx interface{}, dto interface{}) *FakeDashboardService_ImportDashboard_Call {
|
||||
return &FakeDashboardService_ImportDashboard_Call{Call: _e.mock.On("ImportDashboard", ctx, dto)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_ImportDashboard_Call) Run(run func(ctx context.Context, dto *SaveDashboardDTO)) *FakeDashboardService_ImportDashboard_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*SaveDashboardDTO))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_ImportDashboard_Call) Return(_a0 *Dashboard, _a1 error) *FakeDashboardService_ImportDashboard_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_ImportDashboard_Call) RunAndReturn(run func(context.Context, *SaveDashboardDTO) (*Dashboard, error)) *FakeDashboardService_ImportDashboard_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// MakeUserAdmin provides a mock function with given fields: ctx, orgID, userID, dashboardID, setViewAndEditPermissions
|
||||
func (_m *FakeDashboardService) MakeUserAdmin(ctx context.Context, orgID int64, userID int64, dashboardID int64, setViewAndEditPermissions bool) error {
|
||||
ret := _m.Called(ctx, orgID, userID, dashboardID, setViewAndEditPermissions)
|
||||
@ -730,38 +290,6 @@ func (_m *FakeDashboardService) MakeUserAdmin(ctx context.Context, orgID int64,
|
||||
return r0
|
||||
}
|
||||
|
||||
// FakeDashboardService_MakeUserAdmin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeUserAdmin'
|
||||
type FakeDashboardService_MakeUserAdmin_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// MakeUserAdmin is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - orgID int64
|
||||
// - userID int64
|
||||
// - dashboardID int64
|
||||
// - setViewAndEditPermissions bool
|
||||
func (_e *FakeDashboardService_Expecter) MakeUserAdmin(ctx interface{}, orgID interface{}, userID interface{}, dashboardID interface{}, setViewAndEditPermissions interface{}) *FakeDashboardService_MakeUserAdmin_Call {
|
||||
return &FakeDashboardService_MakeUserAdmin_Call{Call: _e.mock.On("MakeUserAdmin", ctx, orgID, userID, dashboardID, setViewAndEditPermissions)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_MakeUserAdmin_Call) Run(run func(ctx context.Context, orgID int64, userID int64, dashboardID int64, setViewAndEditPermissions bool)) *FakeDashboardService_MakeUserAdmin_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(int64), args[2].(int64), args[3].(int64), args[4].(bool))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_MakeUserAdmin_Call) Return(_a0 error) *FakeDashboardService_MakeUserAdmin_Call {
|
||||
_c.Call.Return(_a0)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_MakeUserAdmin_Call) RunAndReturn(run func(context.Context, int64, int64, int64, bool) error) *FakeDashboardService_MakeUserAdmin_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SaveDashboard provides a mock function with given fields: ctx, dto, allowUiUpdate
|
||||
func (_m *FakeDashboardService) SaveDashboard(ctx context.Context, dto *SaveDashboardDTO, allowUiUpdate bool) (*Dashboard, error) {
|
||||
ret := _m.Called(ctx, dto, allowUiUpdate)
|
||||
@ -788,36 +316,6 @@ func (_m *FakeDashboardService) SaveDashboard(ctx context.Context, dto *SaveDash
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardService_SaveDashboard_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveDashboard'
|
||||
type FakeDashboardService_SaveDashboard_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// SaveDashboard is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - dto *SaveDashboardDTO
|
||||
// - allowUiUpdate bool
|
||||
func (_e *FakeDashboardService_Expecter) SaveDashboard(ctx interface{}, dto interface{}, allowUiUpdate interface{}) *FakeDashboardService_SaveDashboard_Call {
|
||||
return &FakeDashboardService_SaveDashboard_Call{Call: _e.mock.On("SaveDashboard", ctx, dto, allowUiUpdate)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_SaveDashboard_Call) Run(run func(ctx context.Context, dto *SaveDashboardDTO, allowUiUpdate bool)) *FakeDashboardService_SaveDashboard_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*SaveDashboardDTO), args[2].(bool))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_SaveDashboard_Call) Return(_a0 *Dashboard, _a1 error) *FakeDashboardService_SaveDashboard_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_SaveDashboard_Call) RunAndReturn(run func(context.Context, *SaveDashboardDTO, bool) (*Dashboard, error)) *FakeDashboardService_SaveDashboard_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SearchDashboards provides a mock function with given fields: ctx, query
|
||||
func (_m *FakeDashboardService) SearchDashboards(ctx context.Context, query *FindPersistedDashboardsQuery) (model.HitList, error) {
|
||||
ret := _m.Called(ctx, query)
|
||||
@ -844,35 +342,6 @@ func (_m *FakeDashboardService) SearchDashboards(ctx context.Context, query *Fin
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardService_SearchDashboards_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SearchDashboards'
|
||||
type FakeDashboardService_SearchDashboards_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// SearchDashboards is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - query *FindPersistedDashboardsQuery
|
||||
func (_e *FakeDashboardService_Expecter) SearchDashboards(ctx interface{}, query interface{}) *FakeDashboardService_SearchDashboards_Call {
|
||||
return &FakeDashboardService_SearchDashboards_Call{Call: _e.mock.On("SearchDashboards", ctx, query)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_SearchDashboards_Call) Run(run func(ctx context.Context, query *FindPersistedDashboardsQuery)) *FakeDashboardService_SearchDashboards_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*FindPersistedDashboardsQuery))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_SearchDashboards_Call) Return(_a0 model.HitList, _a1 error) *FakeDashboardService_SearchDashboards_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_SearchDashboards_Call) RunAndReturn(run func(context.Context, *FindPersistedDashboardsQuery) (model.HitList, error)) *FakeDashboardService_SearchDashboards_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// UpdateDashboardACL provides a mock function with given fields: ctx, uid, items
|
||||
func (_m *FakeDashboardService) UpdateDashboardACL(ctx context.Context, uid int64, items []*DashboardACL) error {
|
||||
ret := _m.Called(ctx, uid, items)
|
||||
@ -887,36 +356,6 @@ func (_m *FakeDashboardService) UpdateDashboardACL(ctx context.Context, uid int6
|
||||
return r0
|
||||
}
|
||||
|
||||
// FakeDashboardService_UpdateDashboardACL_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDashboardACL'
|
||||
type FakeDashboardService_UpdateDashboardACL_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// UpdateDashboardACL is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - uid int64
|
||||
// - items []*DashboardACL
|
||||
func (_e *FakeDashboardService_Expecter) UpdateDashboardACL(ctx interface{}, uid interface{}, items interface{}) *FakeDashboardService_UpdateDashboardACL_Call {
|
||||
return &FakeDashboardService_UpdateDashboardACL_Call{Call: _e.mock.On("UpdateDashboardACL", ctx, uid, items)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_UpdateDashboardACL_Call) Run(run func(ctx context.Context, uid int64, items []*DashboardACL)) *FakeDashboardService_UpdateDashboardACL_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(int64), args[2].([]*DashboardACL))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_UpdateDashboardACL_Call) Return(_a0 error) *FakeDashboardService_UpdateDashboardACL_Call {
|
||||
_c.Call.Return(_a0)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardService_UpdateDashboardACL_Call) RunAndReturn(run func(context.Context, int64, []*DashboardACL) error) *FakeDashboardService_UpdateDashboardACL_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
type mockConstructorTestingTNewFakeDashboardService interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
|
@ -5,9 +5,6 @@ import (
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/db"
|
||||
"github.com/grafana/grafana/pkg/services/dashboards"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/services/folder"
|
||||
"github.com/grafana/grafana/pkg/services/org"
|
||||
)
|
||||
|
||||
// GetDashboardACLInfoList returns a list of permissions for a dashboard. They can be fetched from three
|
||||
@ -97,81 +94,6 @@ func (d *dashboardStore) GetDashboardACLInfoList(ctx context.Context, query *das
|
||||
return queryResult, nil
|
||||
}
|
||||
|
||||
// HasEditPermissionInFolders validates that an user have access to a certain folder
|
||||
func (d *dashboardStore) HasEditPermissionInFolders(ctx context.Context, query *folder.HasEditPermissionInFoldersQuery) (bool, error) {
|
||||
var queryResult bool
|
||||
if query.SignedInUser.HasRole(org.RoleEditor) {
|
||||
queryResult = true
|
||||
return queryResult, nil
|
||||
}
|
||||
|
||||
recursiveQueriesAreSupported, err := d.store.RecursiveQueriesAreSupported()
|
||||
if err != nil {
|
||||
return queryResult, err
|
||||
}
|
||||
|
||||
err = d.store.WithDbSession(ctx, func(dbSession *db.Session) error {
|
||||
builder := db.NewSqlBuilder(d.cfg, featuremgmt.WithFeatures(), d.store.GetDialect(), recursiveQueriesAreSupported)
|
||||
builder.Write("SELECT COUNT(dashboard.id) AS count FROM dashboard WHERE dashboard.org_id = ? AND dashboard.is_folder = ?",
|
||||
query.SignedInUser.OrgID, d.store.GetDialect().BooleanStr(true))
|
||||
builder.WriteDashboardPermissionFilter(query.SignedInUser, dashboards.PERMISSION_EDIT)
|
||||
|
||||
type folderCount struct {
|
||||
Count int64
|
||||
}
|
||||
|
||||
resp := make([]*folderCount, 0)
|
||||
|
||||
if err := dbSession.SQL(builder.GetSQLString(), builder.GetParams()...).Find(&resp); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
queryResult = len(resp) > 0 && resp[0].Count > 0
|
||||
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return queryResult, err
|
||||
}
|
||||
return queryResult, nil
|
||||
}
|
||||
|
||||
func (d *dashboardStore) HasAdminPermissionInDashboardsOrFolders(ctx context.Context, query *folder.HasAdminPermissionInDashboardsOrFoldersQuery) (bool, error) {
|
||||
var queryResult bool
|
||||
recursiveQueriesAreSupported, err := d.store.RecursiveQueriesAreSupported()
|
||||
if err != nil {
|
||||
return queryResult, err
|
||||
}
|
||||
|
||||
err = d.store.WithDbSession(ctx, func(dbSession *db.Session) error {
|
||||
if query.SignedInUser.HasRole(org.RoleAdmin) {
|
||||
queryResult = true
|
||||
return nil
|
||||
}
|
||||
|
||||
builder := db.NewSqlBuilder(d.cfg, featuremgmt.WithFeatures(), d.store.GetDialect(), recursiveQueriesAreSupported)
|
||||
builder.Write("SELECT COUNT(dashboard.id) AS count FROM dashboard WHERE dashboard.org_id = ?", query.SignedInUser.OrgID)
|
||||
builder.WriteDashboardPermissionFilter(query.SignedInUser, dashboards.PERMISSION_ADMIN)
|
||||
|
||||
type folderCount struct {
|
||||
Count int64
|
||||
}
|
||||
|
||||
resp := make([]*folderCount, 0)
|
||||
if err := dbSession.SQL(builder.GetSQLString(), builder.GetParams()...).Find(&resp); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
queryResult = len(resp) > 0 && resp[0].Count > 0
|
||||
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return queryResult, err
|
||||
}
|
||||
return queryResult, nil
|
||||
}
|
||||
|
||||
func (d *dashboardStore) DeleteACLByUser(ctx context.Context, userID int64) error {
|
||||
return d.store.WithTransactionalDbSession(ctx, func(sess *db.Session) error {
|
||||
var rawSQL = "DELETE FROM dashboard_acl WHERE user_id = ?"
|
||||
|
@ -338,24 +338,6 @@ func TestIntegrationDashboardFolderDataAccess(t *testing.T) {
|
||||
require.Equal(t, hits[0].ID, folder1.ID)
|
||||
require.Equal(t, hits[1].ID, folder2.ID)
|
||||
})
|
||||
|
||||
t.Run("should have edit permission in folders", func(t *testing.T) {
|
||||
query := &folder.HasEditPermissionInFoldersQuery{
|
||||
SignedInUser: &user.SignedInUser{UserID: adminUser.ID, OrgID: 1, OrgRole: org.RoleAdmin},
|
||||
}
|
||||
queryResult, err := dashboardStore.HasEditPermissionInFolders(context.Background(), query)
|
||||
require.NoError(t, err)
|
||||
require.True(t, queryResult)
|
||||
})
|
||||
|
||||
t.Run("should have admin permission in folders", func(t *testing.T) {
|
||||
query := &folder.HasAdminPermissionInDashboardsOrFoldersQuery{
|
||||
SignedInUser: &user.SignedInUser{UserID: adminUser.ID, OrgID: 1, OrgRole: org.RoleAdmin},
|
||||
}
|
||||
queryResult, err := dashboardStore.HasAdminPermissionInDashboardsOrFolders(context.Background(), query)
|
||||
require.NoError(t, err)
|
||||
require.True(t, queryResult)
|
||||
})
|
||||
})
|
||||
|
||||
t.Run("Editor users", func(t *testing.T) {
|
||||
@ -386,24 +368,6 @@ func TestIntegrationDashboardFolderDataAccess(t *testing.T) {
|
||||
require.Equal(t, len(hits), 1)
|
||||
require.Equal(t, hits[0].ID, folder2.ID)
|
||||
})
|
||||
|
||||
t.Run("should have edit permission in folders", func(t *testing.T) {
|
||||
query := &folder.HasEditPermissionInFoldersQuery{
|
||||
SignedInUser: &user.SignedInUser{UserID: editorUser.ID, OrgID: 1, OrgRole: org.RoleEditor},
|
||||
}
|
||||
queryResult, err := dashboardStore.HasEditPermissionInFolders(context.Background(), query)
|
||||
go require.NoError(t, err)
|
||||
require.True(t, queryResult)
|
||||
})
|
||||
|
||||
t.Run("should not have admin permission in folders", func(t *testing.T) {
|
||||
query := &folder.HasAdminPermissionInDashboardsOrFoldersQuery{
|
||||
SignedInUser: &user.SignedInUser{UserID: adminUser.ID, OrgID: 1, OrgRole: org.RoleEditor},
|
||||
}
|
||||
queryResult, err := dashboardStore.HasAdminPermissionInDashboardsOrFolders(context.Background(), query)
|
||||
require.NoError(t, err)
|
||||
require.False(t, queryResult)
|
||||
})
|
||||
})
|
||||
|
||||
t.Run("Viewer users", func(t *testing.T) {
|
||||
@ -432,58 +396,6 @@ func TestIntegrationDashboardFolderDataAccess(t *testing.T) {
|
||||
require.Equal(t, len(hits), 1)
|
||||
require.Equal(t, hits[0].ID, folder1.ID)
|
||||
})
|
||||
|
||||
t.Run("should not have edit permission in folders", func(t *testing.T) {
|
||||
setup3()
|
||||
|
||||
query := &folder.HasEditPermissionInFoldersQuery{
|
||||
SignedInUser: &user.SignedInUser{UserID: viewerUser.ID, OrgID: 1, OrgRole: org.RoleViewer},
|
||||
}
|
||||
queryResult, err := dashboardStore.HasEditPermissionInFolders(context.Background(), query)
|
||||
go require.NoError(t, err)
|
||||
require.False(t, queryResult)
|
||||
})
|
||||
|
||||
t.Run("should not have admin permission in folders", func(t *testing.T) {
|
||||
query := &folder.HasAdminPermissionInDashboardsOrFoldersQuery{
|
||||
SignedInUser: &user.SignedInUser{UserID: adminUser.ID, OrgID: 1, OrgRole: org.RoleViewer},
|
||||
}
|
||||
queryResult, err := dashboardStore.HasAdminPermissionInDashboardsOrFolders(context.Background(), query)
|
||||
require.NoError(t, err)
|
||||
require.False(t, queryResult)
|
||||
})
|
||||
|
||||
t.Run("and admin permission is given for user with org role viewer in one dashboard folder", func(t *testing.T) {
|
||||
err := updateDashboardACL(t, dashboardStore, folder1.ID, dashboards.DashboardACL{
|
||||
DashboardID: folder1.ID, OrgID: 1, UserID: viewerUser.ID, Permission: dashboards.PERMISSION_ADMIN,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
t.Run("should have edit permission in folders", func(t *testing.T) {
|
||||
query := &folder.HasEditPermissionInFoldersQuery{
|
||||
SignedInUser: &user.SignedInUser{UserID: viewerUser.ID, OrgID: 1, OrgRole: org.RoleViewer},
|
||||
}
|
||||
queryResult, err := dashboardStore.HasEditPermissionInFolders(context.Background(), query)
|
||||
go require.NoError(t, err)
|
||||
require.True(t, queryResult)
|
||||
})
|
||||
})
|
||||
|
||||
t.Run("and edit permission is given for user with org role viewer in one dashboard folder", func(t *testing.T) {
|
||||
err := updateDashboardACL(t, dashboardStore, folder1.ID, dashboards.DashboardACL{
|
||||
DashboardID: folder1.ID, OrgID: 1, UserID: viewerUser.ID, Permission: dashboards.PERMISSION_EDIT,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
t.Run("should have edit permission in folders", func(t *testing.T) {
|
||||
query := &folder.HasEditPermissionInFoldersQuery{
|
||||
SignedInUser: &user.SignedInUser{UserID: viewerUser.ID, OrgID: 1, OrgRole: org.RoleViewer},
|
||||
}
|
||||
queryResult, err := dashboardStore.HasEditPermissionInFolders(context.Background(), query)
|
||||
go require.NoError(t, err)
|
||||
require.True(t, queryResult)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -618,14 +618,6 @@ func (dr *DashboardServiceImpl) GetDashboardACLInfoList(ctx context.Context, que
|
||||
return dr.dashboardStore.GetDashboardACLInfoList(ctx, query)
|
||||
}
|
||||
|
||||
func (dr *DashboardServiceImpl) HasAdminPermissionInDashboardsOrFolders(ctx context.Context, query *folder.HasAdminPermissionInDashboardsOrFoldersQuery) (bool, error) {
|
||||
return dr.dashboardStore.HasAdminPermissionInDashboardsOrFolders(ctx, query)
|
||||
}
|
||||
|
||||
func (dr *DashboardServiceImpl) HasEditPermissionInFolders(ctx context.Context, query *folder.HasEditPermissionInFoldersQuery) (bool, error) {
|
||||
return dr.dashboardStore.HasEditPermissionInFolders(ctx, query)
|
||||
}
|
||||
|
||||
func (dr *DashboardServiceImpl) GetDashboardTags(ctx context.Context, query *dashboards.GetDashboardTagsQuery) ([]*dashboards.DashboardTagCloudItem, error) {
|
||||
return dr.dashboardStore.GetDashboardTags(ctx, query)
|
||||
}
|
||||
|
@ -1,14 +1,12 @@
|
||||
// Code generated by mockery v2.23.2. DO NOT EDIT.
|
||||
// Code generated by mockery v2.28.0. DO NOT EDIT.
|
||||
|
||||
package dashboards
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
folder "github.com/grafana/grafana/pkg/services/folder"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
models "github.com/grafana/grafana/pkg/services/alerting/models"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
quota "github.com/grafana/grafana/pkg/services/quota"
|
||||
)
|
||||
@ -18,14 +16,6 @@ type FakeDashboardStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
type FakeDashboardStore_Expecter struct {
|
||||
mock *mock.Mock
|
||||
}
|
||||
|
||||
func (_m *FakeDashboardStore) EXPECT() *FakeDashboardStore_Expecter {
|
||||
return &FakeDashboardStore_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// Count provides a mock function with given fields: _a0, _a1
|
||||
func (_m *FakeDashboardStore) Count(_a0 context.Context, _a1 *quota.ScopeParameters) (*quota.Map, error) {
|
||||
ret := _m.Called(_a0, _a1)
|
||||
@ -52,35 +42,6 @@ func (_m *FakeDashboardStore) Count(_a0 context.Context, _a1 *quota.ScopeParamet
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardStore_Count_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Count'
|
||||
type FakeDashboardStore_Count_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// Count is a helper method to define mock.On call
|
||||
// - _a0 context.Context
|
||||
// - _a1 *quota.ScopeParameters
|
||||
func (_e *FakeDashboardStore_Expecter) Count(_a0 interface{}, _a1 interface{}) *FakeDashboardStore_Count_Call {
|
||||
return &FakeDashboardStore_Count_Call{Call: _e.mock.On("Count", _a0, _a1)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_Count_Call) Run(run func(_a0 context.Context, _a1 *quota.ScopeParameters)) *FakeDashboardStore_Count_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*quota.ScopeParameters))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_Count_Call) Return(_a0 *quota.Map, _a1 error) *FakeDashboardStore_Count_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_Count_Call) RunAndReturn(run func(context.Context, *quota.ScopeParameters) (*quota.Map, error)) *FakeDashboardStore_Count_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// CountDashboardsInFolder provides a mock function with given fields: ctx, request
|
||||
func (_m *FakeDashboardStore) CountDashboardsInFolder(ctx context.Context, request *CountDashboardsInFolderRequest) (int64, error) {
|
||||
ret := _m.Called(ctx, request)
|
||||
@ -105,35 +66,6 @@ func (_m *FakeDashboardStore) CountDashboardsInFolder(ctx context.Context, reque
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardStore_CountDashboardsInFolder_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountDashboardsInFolder'
|
||||
type FakeDashboardStore_CountDashboardsInFolder_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// CountDashboardsInFolder is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - request *CountDashboardsInFolderRequest
|
||||
func (_e *FakeDashboardStore_Expecter) CountDashboardsInFolder(ctx interface{}, request interface{}) *FakeDashboardStore_CountDashboardsInFolder_Call {
|
||||
return &FakeDashboardStore_CountDashboardsInFolder_Call{Call: _e.mock.On("CountDashboardsInFolder", ctx, request)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_CountDashboardsInFolder_Call) Run(run func(ctx context.Context, request *CountDashboardsInFolderRequest)) *FakeDashboardStore_CountDashboardsInFolder_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*CountDashboardsInFolderRequest))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_CountDashboardsInFolder_Call) Return(_a0 int64, _a1 error) *FakeDashboardStore_CountDashboardsInFolder_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_CountDashboardsInFolder_Call) RunAndReturn(run func(context.Context, *CountDashboardsInFolderRequest) (int64, error)) *FakeDashboardStore_CountDashboardsInFolder_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// DeleteACLByUser provides a mock function with given fields: _a0, _a1
|
||||
func (_m *FakeDashboardStore) DeleteACLByUser(_a0 context.Context, _a1 int64) error {
|
||||
ret := _m.Called(_a0, _a1)
|
||||
@ -148,35 +80,6 @@ func (_m *FakeDashboardStore) DeleteACLByUser(_a0 context.Context, _a1 int64) er
|
||||
return r0
|
||||
}
|
||||
|
||||
// FakeDashboardStore_DeleteACLByUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteACLByUser'
|
||||
type FakeDashboardStore_DeleteACLByUser_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// DeleteACLByUser is a helper method to define mock.On call
|
||||
// - _a0 context.Context
|
||||
// - _a1 int64
|
||||
func (_e *FakeDashboardStore_Expecter) DeleteACLByUser(_a0 interface{}, _a1 interface{}) *FakeDashboardStore_DeleteACLByUser_Call {
|
||||
return &FakeDashboardStore_DeleteACLByUser_Call{Call: _e.mock.On("DeleteACLByUser", _a0, _a1)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_DeleteACLByUser_Call) Run(run func(_a0 context.Context, _a1 int64)) *FakeDashboardStore_DeleteACLByUser_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(int64))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_DeleteACLByUser_Call) Return(_a0 error) *FakeDashboardStore_DeleteACLByUser_Call {
|
||||
_c.Call.Return(_a0)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_DeleteACLByUser_Call) RunAndReturn(run func(context.Context, int64) error) *FakeDashboardStore_DeleteACLByUser_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// DeleteDashboard provides a mock function with given fields: ctx, cmd
|
||||
func (_m *FakeDashboardStore) DeleteDashboard(ctx context.Context, cmd *DeleteDashboardCommand) error {
|
||||
ret := _m.Called(ctx, cmd)
|
||||
@ -191,35 +94,6 @@ func (_m *FakeDashboardStore) DeleteDashboard(ctx context.Context, cmd *DeleteDa
|
||||
return r0
|
||||
}
|
||||
|
||||
// FakeDashboardStore_DeleteDashboard_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteDashboard'
|
||||
type FakeDashboardStore_DeleteDashboard_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// DeleteDashboard is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - cmd *DeleteDashboardCommand
|
||||
func (_e *FakeDashboardStore_Expecter) DeleteDashboard(ctx interface{}, cmd interface{}) *FakeDashboardStore_DeleteDashboard_Call {
|
||||
return &FakeDashboardStore_DeleteDashboard_Call{Call: _e.mock.On("DeleteDashboard", ctx, cmd)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_DeleteDashboard_Call) Run(run func(ctx context.Context, cmd *DeleteDashboardCommand)) *FakeDashboardStore_DeleteDashboard_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*DeleteDashboardCommand))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_DeleteDashboard_Call) Return(_a0 error) *FakeDashboardStore_DeleteDashboard_Call {
|
||||
_c.Call.Return(_a0)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_DeleteDashboard_Call) RunAndReturn(run func(context.Context, *DeleteDashboardCommand) error) *FakeDashboardStore_DeleteDashboard_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// DeleteDashboardsInFolder provides a mock function with given fields: ctx, request
|
||||
func (_m *FakeDashboardStore) DeleteDashboardsInFolder(ctx context.Context, request *DeleteDashboardsInFolderRequest) error {
|
||||
ret := _m.Called(ctx, request)
|
||||
@ -234,35 +108,6 @@ func (_m *FakeDashboardStore) DeleteDashboardsInFolder(ctx context.Context, requ
|
||||
return r0
|
||||
}
|
||||
|
||||
// FakeDashboardStore_DeleteDashboardsInFolder_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteDashboardsInFolder'
|
||||
type FakeDashboardStore_DeleteDashboardsInFolder_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// DeleteDashboardsInFolder is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - request *DeleteDashboardsInFolderRequest
|
||||
func (_e *FakeDashboardStore_Expecter) DeleteDashboardsInFolder(ctx interface{}, request interface{}) *FakeDashboardStore_DeleteDashboardsInFolder_Call {
|
||||
return &FakeDashboardStore_DeleteDashboardsInFolder_Call{Call: _e.mock.On("DeleteDashboardsInFolder", ctx, request)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_DeleteDashboardsInFolder_Call) Run(run func(ctx context.Context, request *DeleteDashboardsInFolderRequest)) *FakeDashboardStore_DeleteDashboardsInFolder_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*DeleteDashboardsInFolderRequest))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_DeleteDashboardsInFolder_Call) Return(_a0 error) *FakeDashboardStore_DeleteDashboardsInFolder_Call {
|
||||
_c.Call.Return(_a0)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_DeleteDashboardsInFolder_Call) RunAndReturn(run func(context.Context, *DeleteDashboardsInFolderRequest) error) *FakeDashboardStore_DeleteDashboardsInFolder_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// DeleteOrphanedProvisionedDashboards provides a mock function with given fields: ctx, cmd
|
||||
func (_m *FakeDashboardStore) DeleteOrphanedProvisionedDashboards(ctx context.Context, cmd *DeleteOrphanedProvisionedDashboardsCommand) error {
|
||||
ret := _m.Called(ctx, cmd)
|
||||
@ -277,35 +122,6 @@ func (_m *FakeDashboardStore) DeleteOrphanedProvisionedDashboards(ctx context.Co
|
||||
return r0
|
||||
}
|
||||
|
||||
// FakeDashboardStore_DeleteOrphanedProvisionedDashboards_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteOrphanedProvisionedDashboards'
|
||||
type FakeDashboardStore_DeleteOrphanedProvisionedDashboards_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// DeleteOrphanedProvisionedDashboards is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - cmd *DeleteOrphanedProvisionedDashboardsCommand
|
||||
func (_e *FakeDashboardStore_Expecter) DeleteOrphanedProvisionedDashboards(ctx interface{}, cmd interface{}) *FakeDashboardStore_DeleteOrphanedProvisionedDashboards_Call {
|
||||
return &FakeDashboardStore_DeleteOrphanedProvisionedDashboards_Call{Call: _e.mock.On("DeleteOrphanedProvisionedDashboards", ctx, cmd)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_DeleteOrphanedProvisionedDashboards_Call) Run(run func(ctx context.Context, cmd *DeleteOrphanedProvisionedDashboardsCommand)) *FakeDashboardStore_DeleteOrphanedProvisionedDashboards_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*DeleteOrphanedProvisionedDashboardsCommand))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_DeleteOrphanedProvisionedDashboards_Call) Return(_a0 error) *FakeDashboardStore_DeleteOrphanedProvisionedDashboards_Call {
|
||||
_c.Call.Return(_a0)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_DeleteOrphanedProvisionedDashboards_Call) RunAndReturn(run func(context.Context, *DeleteOrphanedProvisionedDashboardsCommand) error) *FakeDashboardStore_DeleteOrphanedProvisionedDashboards_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// FindDashboards provides a mock function with given fields: ctx, query
|
||||
func (_m *FakeDashboardStore) FindDashboards(ctx context.Context, query *FindPersistedDashboardsQuery) ([]DashboardSearchProjection, error) {
|
||||
ret := _m.Called(ctx, query)
|
||||
@ -332,35 +148,6 @@ func (_m *FakeDashboardStore) FindDashboards(ctx context.Context, query *FindPer
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardStore_FindDashboards_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindDashboards'
|
||||
type FakeDashboardStore_FindDashboards_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// FindDashboards is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - query *FindPersistedDashboardsQuery
|
||||
func (_e *FakeDashboardStore_Expecter) FindDashboards(ctx interface{}, query interface{}) *FakeDashboardStore_FindDashboards_Call {
|
||||
return &FakeDashboardStore_FindDashboards_Call{Call: _e.mock.On("FindDashboards", ctx, query)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_FindDashboards_Call) Run(run func(ctx context.Context, query *FindPersistedDashboardsQuery)) *FakeDashboardStore_FindDashboards_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*FindPersistedDashboardsQuery))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_FindDashboards_Call) Return(_a0 []DashboardSearchProjection, _a1 error) *FakeDashboardStore_FindDashboards_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_FindDashboards_Call) RunAndReturn(run func(context.Context, *FindPersistedDashboardsQuery) ([]DashboardSearchProjection, error)) *FakeDashboardStore_FindDashboards_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetDashboard provides a mock function with given fields: ctx, query
|
||||
func (_m *FakeDashboardStore) GetDashboard(ctx context.Context, query *GetDashboardQuery) (*Dashboard, error) {
|
||||
ret := _m.Called(ctx, query)
|
||||
@ -387,35 +174,6 @@ func (_m *FakeDashboardStore) GetDashboard(ctx context.Context, query *GetDashbo
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardStore_GetDashboard_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDashboard'
|
||||
type FakeDashboardStore_GetDashboard_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetDashboard is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - query *GetDashboardQuery
|
||||
func (_e *FakeDashboardStore_Expecter) GetDashboard(ctx interface{}, query interface{}) *FakeDashboardStore_GetDashboard_Call {
|
||||
return &FakeDashboardStore_GetDashboard_Call{Call: _e.mock.On("GetDashboard", ctx, query)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetDashboard_Call) Run(run func(ctx context.Context, query *GetDashboardQuery)) *FakeDashboardStore_GetDashboard_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*GetDashboardQuery))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetDashboard_Call) Return(_a0 *Dashboard, _a1 error) *FakeDashboardStore_GetDashboard_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetDashboard_Call) RunAndReturn(run func(context.Context, *GetDashboardQuery) (*Dashboard, error)) *FakeDashboardStore_GetDashboard_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetDashboardACLInfoList provides a mock function with given fields: ctx, query
|
||||
func (_m *FakeDashboardStore) GetDashboardACLInfoList(ctx context.Context, query *GetDashboardACLInfoListQuery) ([]*DashboardACLInfoDTO, error) {
|
||||
ret := _m.Called(ctx, query)
|
||||
@ -442,35 +200,6 @@ func (_m *FakeDashboardStore) GetDashboardACLInfoList(ctx context.Context, query
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardStore_GetDashboardACLInfoList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDashboardACLInfoList'
|
||||
type FakeDashboardStore_GetDashboardACLInfoList_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetDashboardACLInfoList is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - query *GetDashboardACLInfoListQuery
|
||||
func (_e *FakeDashboardStore_Expecter) GetDashboardACLInfoList(ctx interface{}, query interface{}) *FakeDashboardStore_GetDashboardACLInfoList_Call {
|
||||
return &FakeDashboardStore_GetDashboardACLInfoList_Call{Call: _e.mock.On("GetDashboardACLInfoList", ctx, query)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetDashboardACLInfoList_Call) Run(run func(ctx context.Context, query *GetDashboardACLInfoListQuery)) *FakeDashboardStore_GetDashboardACLInfoList_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*GetDashboardACLInfoListQuery))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetDashboardACLInfoList_Call) Return(_a0 []*DashboardACLInfoDTO, _a1 error) *FakeDashboardStore_GetDashboardACLInfoList_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetDashboardACLInfoList_Call) RunAndReturn(run func(context.Context, *GetDashboardACLInfoListQuery) ([]*DashboardACLInfoDTO, error)) *FakeDashboardStore_GetDashboardACLInfoList_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetDashboardTags provides a mock function with given fields: ctx, query
|
||||
func (_m *FakeDashboardStore) GetDashboardTags(ctx context.Context, query *GetDashboardTagsQuery) ([]*DashboardTagCloudItem, error) {
|
||||
ret := _m.Called(ctx, query)
|
||||
@ -497,35 +226,6 @@ func (_m *FakeDashboardStore) GetDashboardTags(ctx context.Context, query *GetDa
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardStore_GetDashboardTags_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDashboardTags'
|
||||
type FakeDashboardStore_GetDashboardTags_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetDashboardTags is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - query *GetDashboardTagsQuery
|
||||
func (_e *FakeDashboardStore_Expecter) GetDashboardTags(ctx interface{}, query interface{}) *FakeDashboardStore_GetDashboardTags_Call {
|
||||
return &FakeDashboardStore_GetDashboardTags_Call{Call: _e.mock.On("GetDashboardTags", ctx, query)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetDashboardTags_Call) Run(run func(ctx context.Context, query *GetDashboardTagsQuery)) *FakeDashboardStore_GetDashboardTags_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*GetDashboardTagsQuery))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetDashboardTags_Call) Return(_a0 []*DashboardTagCloudItem, _a1 error) *FakeDashboardStore_GetDashboardTags_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetDashboardTags_Call) RunAndReturn(run func(context.Context, *GetDashboardTagsQuery) ([]*DashboardTagCloudItem, error)) *FakeDashboardStore_GetDashboardTags_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetDashboardUIDByID provides a mock function with given fields: ctx, query
|
||||
func (_m *FakeDashboardStore) GetDashboardUIDByID(ctx context.Context, query *GetDashboardRefByIDQuery) (*DashboardRef, error) {
|
||||
ret := _m.Called(ctx, query)
|
||||
@ -552,35 +252,6 @@ func (_m *FakeDashboardStore) GetDashboardUIDByID(ctx context.Context, query *Ge
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardStore_GetDashboardUIDByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDashboardUIDByID'
|
||||
type FakeDashboardStore_GetDashboardUIDByID_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetDashboardUIDByID is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - query *GetDashboardRefByIDQuery
|
||||
func (_e *FakeDashboardStore_Expecter) GetDashboardUIDByID(ctx interface{}, query interface{}) *FakeDashboardStore_GetDashboardUIDByID_Call {
|
||||
return &FakeDashboardStore_GetDashboardUIDByID_Call{Call: _e.mock.On("GetDashboardUIDByID", ctx, query)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetDashboardUIDByID_Call) Run(run func(ctx context.Context, query *GetDashboardRefByIDQuery)) *FakeDashboardStore_GetDashboardUIDByID_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*GetDashboardRefByIDQuery))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetDashboardUIDByID_Call) Return(_a0 *DashboardRef, _a1 error) *FakeDashboardStore_GetDashboardUIDByID_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetDashboardUIDByID_Call) RunAndReturn(run func(context.Context, *GetDashboardRefByIDQuery) (*DashboardRef, error)) *FakeDashboardStore_GetDashboardUIDByID_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetDashboards provides a mock function with given fields: ctx, query
|
||||
func (_m *FakeDashboardStore) GetDashboards(ctx context.Context, query *GetDashboardsQuery) ([]*Dashboard, error) {
|
||||
ret := _m.Called(ctx, query)
|
||||
@ -607,35 +278,6 @@ func (_m *FakeDashboardStore) GetDashboards(ctx context.Context, query *GetDashb
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardStore_GetDashboards_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDashboards'
|
||||
type FakeDashboardStore_GetDashboards_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetDashboards is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - query *GetDashboardsQuery
|
||||
func (_e *FakeDashboardStore_Expecter) GetDashboards(ctx interface{}, query interface{}) *FakeDashboardStore_GetDashboards_Call {
|
||||
return &FakeDashboardStore_GetDashboards_Call{Call: _e.mock.On("GetDashboards", ctx, query)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetDashboards_Call) Run(run func(ctx context.Context, query *GetDashboardsQuery)) *FakeDashboardStore_GetDashboards_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*GetDashboardsQuery))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetDashboards_Call) Return(_a0 []*Dashboard, _a1 error) *FakeDashboardStore_GetDashboards_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetDashboards_Call) RunAndReturn(run func(context.Context, *GetDashboardsQuery) ([]*Dashboard, error)) *FakeDashboardStore_GetDashboards_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetDashboardsByPluginID provides a mock function with given fields: ctx, query
|
||||
func (_m *FakeDashboardStore) GetDashboardsByPluginID(ctx context.Context, query *GetDashboardsByPluginIDQuery) ([]*Dashboard, error) {
|
||||
ret := _m.Called(ctx, query)
|
||||
@ -662,35 +304,6 @@ func (_m *FakeDashboardStore) GetDashboardsByPluginID(ctx context.Context, query
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardStore_GetDashboardsByPluginID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDashboardsByPluginID'
|
||||
type FakeDashboardStore_GetDashboardsByPluginID_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetDashboardsByPluginID is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - query *GetDashboardsByPluginIDQuery
|
||||
func (_e *FakeDashboardStore_Expecter) GetDashboardsByPluginID(ctx interface{}, query interface{}) *FakeDashboardStore_GetDashboardsByPluginID_Call {
|
||||
return &FakeDashboardStore_GetDashboardsByPluginID_Call{Call: _e.mock.On("GetDashboardsByPluginID", ctx, query)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetDashboardsByPluginID_Call) Run(run func(ctx context.Context, query *GetDashboardsByPluginIDQuery)) *FakeDashboardStore_GetDashboardsByPluginID_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*GetDashboardsByPluginIDQuery))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetDashboardsByPluginID_Call) Return(_a0 []*Dashboard, _a1 error) *FakeDashboardStore_GetDashboardsByPluginID_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetDashboardsByPluginID_Call) RunAndReturn(run func(context.Context, *GetDashboardsByPluginIDQuery) ([]*Dashboard, error)) *FakeDashboardStore_GetDashboardsByPluginID_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetProvisionedDashboardData provides a mock function with given fields: ctx, name
|
||||
func (_m *FakeDashboardStore) GetProvisionedDashboardData(ctx context.Context, name string) ([]*DashboardProvisioning, error) {
|
||||
ret := _m.Called(ctx, name)
|
||||
@ -717,35 +330,6 @@ func (_m *FakeDashboardStore) GetProvisionedDashboardData(ctx context.Context, n
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardStore_GetProvisionedDashboardData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProvisionedDashboardData'
|
||||
type FakeDashboardStore_GetProvisionedDashboardData_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetProvisionedDashboardData is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - name string
|
||||
func (_e *FakeDashboardStore_Expecter) GetProvisionedDashboardData(ctx interface{}, name interface{}) *FakeDashboardStore_GetProvisionedDashboardData_Call {
|
||||
return &FakeDashboardStore_GetProvisionedDashboardData_Call{Call: _e.mock.On("GetProvisionedDashboardData", ctx, name)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetProvisionedDashboardData_Call) Run(run func(ctx context.Context, name string)) *FakeDashboardStore_GetProvisionedDashboardData_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetProvisionedDashboardData_Call) Return(_a0 []*DashboardProvisioning, _a1 error) *FakeDashboardStore_GetProvisionedDashboardData_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetProvisionedDashboardData_Call) RunAndReturn(run func(context.Context, string) ([]*DashboardProvisioning, error)) *FakeDashboardStore_GetProvisionedDashboardData_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetProvisionedDataByDashboardID provides a mock function with given fields: ctx, dashboardID
|
||||
func (_m *FakeDashboardStore) GetProvisionedDataByDashboardID(ctx context.Context, dashboardID int64) (*DashboardProvisioning, error) {
|
||||
ret := _m.Called(ctx, dashboardID)
|
||||
@ -772,35 +356,6 @@ func (_m *FakeDashboardStore) GetProvisionedDataByDashboardID(ctx context.Contex
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardStore_GetProvisionedDataByDashboardID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProvisionedDataByDashboardID'
|
||||
type FakeDashboardStore_GetProvisionedDataByDashboardID_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetProvisionedDataByDashboardID is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - dashboardID int64
|
||||
func (_e *FakeDashboardStore_Expecter) GetProvisionedDataByDashboardID(ctx interface{}, dashboardID interface{}) *FakeDashboardStore_GetProvisionedDataByDashboardID_Call {
|
||||
return &FakeDashboardStore_GetProvisionedDataByDashboardID_Call{Call: _e.mock.On("GetProvisionedDataByDashboardID", ctx, dashboardID)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetProvisionedDataByDashboardID_Call) Run(run func(ctx context.Context, dashboardID int64)) *FakeDashboardStore_GetProvisionedDataByDashboardID_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(int64))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetProvisionedDataByDashboardID_Call) Return(_a0 *DashboardProvisioning, _a1 error) *FakeDashboardStore_GetProvisionedDataByDashboardID_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetProvisionedDataByDashboardID_Call) RunAndReturn(run func(context.Context, int64) (*DashboardProvisioning, error)) *FakeDashboardStore_GetProvisionedDataByDashboardID_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetProvisionedDataByDashboardUID provides a mock function with given fields: ctx, orgID, dashboardUID
|
||||
func (_m *FakeDashboardStore) GetProvisionedDataByDashboardUID(ctx context.Context, orgID int64, dashboardUID string) (*DashboardProvisioning, error) {
|
||||
ret := _m.Called(ctx, orgID, dashboardUID)
|
||||
@ -827,142 +382,6 @@ func (_m *FakeDashboardStore) GetProvisionedDataByDashboardUID(ctx context.Conte
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardStore_GetProvisionedDataByDashboardUID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProvisionedDataByDashboardUID'
|
||||
type FakeDashboardStore_GetProvisionedDataByDashboardUID_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetProvisionedDataByDashboardUID is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - orgID int64
|
||||
// - dashboardUID string
|
||||
func (_e *FakeDashboardStore_Expecter) GetProvisionedDataByDashboardUID(ctx interface{}, orgID interface{}, dashboardUID interface{}) *FakeDashboardStore_GetProvisionedDataByDashboardUID_Call {
|
||||
return &FakeDashboardStore_GetProvisionedDataByDashboardUID_Call{Call: _e.mock.On("GetProvisionedDataByDashboardUID", ctx, orgID, dashboardUID)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetProvisionedDataByDashboardUID_Call) Run(run func(ctx context.Context, orgID int64, dashboardUID string)) *FakeDashboardStore_GetProvisionedDataByDashboardUID_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(int64), args[2].(string))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetProvisionedDataByDashboardUID_Call) Return(_a0 *DashboardProvisioning, _a1 error) *FakeDashboardStore_GetProvisionedDataByDashboardUID_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_GetProvisionedDataByDashboardUID_Call) RunAndReturn(run func(context.Context, int64, string) (*DashboardProvisioning, error)) *FakeDashboardStore_GetProvisionedDataByDashboardUID_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// HasAdminPermissionInDashboardsOrFolders provides a mock function with given fields: ctx, query
|
||||
func (_m *FakeDashboardStore) HasAdminPermissionInDashboardsOrFolders(ctx context.Context, query *folder.HasAdminPermissionInDashboardsOrFoldersQuery) (bool, error) {
|
||||
ret := _m.Called(ctx, query)
|
||||
|
||||
var r0 bool
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *folder.HasAdminPermissionInDashboardsOrFoldersQuery) (bool, error)); ok {
|
||||
return rf(ctx, query)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *folder.HasAdminPermissionInDashboardsOrFoldersQuery) bool); ok {
|
||||
r0 = rf(ctx, query)
|
||||
} else {
|
||||
r0 = ret.Get(0).(bool)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *folder.HasAdminPermissionInDashboardsOrFoldersQuery) error); ok {
|
||||
r1 = rf(ctx, query)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardStore_HasAdminPermissionInDashboardsOrFolders_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasAdminPermissionInDashboardsOrFolders'
|
||||
type FakeDashboardStore_HasAdminPermissionInDashboardsOrFolders_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// HasAdminPermissionInDashboardsOrFolders is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - query *folder.HasAdminPermissionInDashboardsOrFoldersQuery
|
||||
func (_e *FakeDashboardStore_Expecter) HasAdminPermissionInDashboardsOrFolders(ctx interface{}, query interface{}) *FakeDashboardStore_HasAdminPermissionInDashboardsOrFolders_Call {
|
||||
return &FakeDashboardStore_HasAdminPermissionInDashboardsOrFolders_Call{Call: _e.mock.On("HasAdminPermissionInDashboardsOrFolders", ctx, query)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_HasAdminPermissionInDashboardsOrFolders_Call) Run(run func(ctx context.Context, query *folder.HasAdminPermissionInDashboardsOrFoldersQuery)) *FakeDashboardStore_HasAdminPermissionInDashboardsOrFolders_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*folder.HasAdminPermissionInDashboardsOrFoldersQuery))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_HasAdminPermissionInDashboardsOrFolders_Call) Return(_a0 bool, _a1 error) *FakeDashboardStore_HasAdminPermissionInDashboardsOrFolders_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_HasAdminPermissionInDashboardsOrFolders_Call) RunAndReturn(run func(context.Context, *folder.HasAdminPermissionInDashboardsOrFoldersQuery) (bool, error)) *FakeDashboardStore_HasAdminPermissionInDashboardsOrFolders_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// HasEditPermissionInFolders provides a mock function with given fields: ctx, query
|
||||
func (_m *FakeDashboardStore) HasEditPermissionInFolders(ctx context.Context, query *folder.HasEditPermissionInFoldersQuery) (bool, error) {
|
||||
ret := _m.Called(ctx, query)
|
||||
|
||||
var r0 bool
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *folder.HasEditPermissionInFoldersQuery) (bool, error)); ok {
|
||||
return rf(ctx, query)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *folder.HasEditPermissionInFoldersQuery) bool); ok {
|
||||
r0 = rf(ctx, query)
|
||||
} else {
|
||||
r0 = ret.Get(0).(bool)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *folder.HasEditPermissionInFoldersQuery) error); ok {
|
||||
r1 = rf(ctx, query)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardStore_HasEditPermissionInFolders_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasEditPermissionInFolders'
|
||||
type FakeDashboardStore_HasEditPermissionInFolders_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// HasEditPermissionInFolders is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - query *folder.HasEditPermissionInFoldersQuery
|
||||
func (_e *FakeDashboardStore_Expecter) HasEditPermissionInFolders(ctx interface{}, query interface{}) *FakeDashboardStore_HasEditPermissionInFolders_Call {
|
||||
return &FakeDashboardStore_HasEditPermissionInFolders_Call{Call: _e.mock.On("HasEditPermissionInFolders", ctx, query)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_HasEditPermissionInFolders_Call) Run(run func(ctx context.Context, query *folder.HasEditPermissionInFoldersQuery)) *FakeDashboardStore_HasEditPermissionInFolders_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*folder.HasEditPermissionInFoldersQuery))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_HasEditPermissionInFolders_Call) Return(_a0 bool, _a1 error) *FakeDashboardStore_HasEditPermissionInFolders_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_HasEditPermissionInFolders_Call) RunAndReturn(run func(context.Context, *folder.HasEditPermissionInFoldersQuery) (bool, error)) *FakeDashboardStore_HasEditPermissionInFolders_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SaveAlerts provides a mock function with given fields: ctx, dashID, alerts
|
||||
func (_m *FakeDashboardStore) SaveAlerts(ctx context.Context, dashID int64, alerts []*models.Alert) error {
|
||||
ret := _m.Called(ctx, dashID, alerts)
|
||||
@ -977,36 +396,6 @@ func (_m *FakeDashboardStore) SaveAlerts(ctx context.Context, dashID int64, aler
|
||||
return r0
|
||||
}
|
||||
|
||||
// FakeDashboardStore_SaveAlerts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveAlerts'
|
||||
type FakeDashboardStore_SaveAlerts_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// SaveAlerts is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - dashID int64
|
||||
// - alerts []*models.Alert
|
||||
func (_e *FakeDashboardStore_Expecter) SaveAlerts(ctx interface{}, dashID interface{}, alerts interface{}) *FakeDashboardStore_SaveAlerts_Call {
|
||||
return &FakeDashboardStore_SaveAlerts_Call{Call: _e.mock.On("SaveAlerts", ctx, dashID, alerts)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_SaveAlerts_Call) Run(run func(ctx context.Context, dashID int64, alerts []*models.Alert)) *FakeDashboardStore_SaveAlerts_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(int64), args[2].([]*models.Alert))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_SaveAlerts_Call) Return(_a0 error) *FakeDashboardStore_SaveAlerts_Call {
|
||||
_c.Call.Return(_a0)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_SaveAlerts_Call) RunAndReturn(run func(context.Context, int64, []*models.Alert) error) *FakeDashboardStore_SaveAlerts_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SaveDashboard provides a mock function with given fields: ctx, cmd
|
||||
func (_m *FakeDashboardStore) SaveDashboard(ctx context.Context, cmd SaveDashboardCommand) (*Dashboard, error) {
|
||||
ret := _m.Called(ctx, cmd)
|
||||
@ -1033,35 +422,6 @@ func (_m *FakeDashboardStore) SaveDashboard(ctx context.Context, cmd SaveDashboa
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardStore_SaveDashboard_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveDashboard'
|
||||
type FakeDashboardStore_SaveDashboard_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// SaveDashboard is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - cmd SaveDashboardCommand
|
||||
func (_e *FakeDashboardStore_Expecter) SaveDashboard(ctx interface{}, cmd interface{}) *FakeDashboardStore_SaveDashboard_Call {
|
||||
return &FakeDashboardStore_SaveDashboard_Call{Call: _e.mock.On("SaveDashboard", ctx, cmd)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_SaveDashboard_Call) Run(run func(ctx context.Context, cmd SaveDashboardCommand)) *FakeDashboardStore_SaveDashboard_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(SaveDashboardCommand))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_SaveDashboard_Call) Return(_a0 *Dashboard, _a1 error) *FakeDashboardStore_SaveDashboard_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_SaveDashboard_Call) RunAndReturn(run func(context.Context, SaveDashboardCommand) (*Dashboard, error)) *FakeDashboardStore_SaveDashboard_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SaveProvisionedDashboard provides a mock function with given fields: ctx, cmd, provisioning
|
||||
func (_m *FakeDashboardStore) SaveProvisionedDashboard(ctx context.Context, cmd SaveDashboardCommand, provisioning *DashboardProvisioning) (*Dashboard, error) {
|
||||
ret := _m.Called(ctx, cmd, provisioning)
|
||||
@ -1088,36 +448,6 @@ func (_m *FakeDashboardStore) SaveProvisionedDashboard(ctx context.Context, cmd
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardStore_SaveProvisionedDashboard_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveProvisionedDashboard'
|
||||
type FakeDashboardStore_SaveProvisionedDashboard_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// SaveProvisionedDashboard is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - cmd SaveDashboardCommand
|
||||
// - provisioning *DashboardProvisioning
|
||||
func (_e *FakeDashboardStore_Expecter) SaveProvisionedDashboard(ctx interface{}, cmd interface{}, provisioning interface{}) *FakeDashboardStore_SaveProvisionedDashboard_Call {
|
||||
return &FakeDashboardStore_SaveProvisionedDashboard_Call{Call: _e.mock.On("SaveProvisionedDashboard", ctx, cmd, provisioning)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_SaveProvisionedDashboard_Call) Run(run func(ctx context.Context, cmd SaveDashboardCommand, provisioning *DashboardProvisioning)) *FakeDashboardStore_SaveProvisionedDashboard_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(SaveDashboardCommand), args[2].(*DashboardProvisioning))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_SaveProvisionedDashboard_Call) Return(_a0 *Dashboard, _a1 error) *FakeDashboardStore_SaveProvisionedDashboard_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_SaveProvisionedDashboard_Call) RunAndReturn(run func(context.Context, SaveDashboardCommand, *DashboardProvisioning) (*Dashboard, error)) *FakeDashboardStore_SaveProvisionedDashboard_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// UnprovisionDashboard provides a mock function with given fields: ctx, id
|
||||
func (_m *FakeDashboardStore) UnprovisionDashboard(ctx context.Context, id int64) error {
|
||||
ret := _m.Called(ctx, id)
|
||||
@ -1132,35 +462,6 @@ func (_m *FakeDashboardStore) UnprovisionDashboard(ctx context.Context, id int64
|
||||
return r0
|
||||
}
|
||||
|
||||
// FakeDashboardStore_UnprovisionDashboard_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnprovisionDashboard'
|
||||
type FakeDashboardStore_UnprovisionDashboard_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// UnprovisionDashboard is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - id int64
|
||||
func (_e *FakeDashboardStore_Expecter) UnprovisionDashboard(ctx interface{}, id interface{}) *FakeDashboardStore_UnprovisionDashboard_Call {
|
||||
return &FakeDashboardStore_UnprovisionDashboard_Call{Call: _e.mock.On("UnprovisionDashboard", ctx, id)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_UnprovisionDashboard_Call) Run(run func(ctx context.Context, id int64)) *FakeDashboardStore_UnprovisionDashboard_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(int64))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_UnprovisionDashboard_Call) Return(_a0 error) *FakeDashboardStore_UnprovisionDashboard_Call {
|
||||
_c.Call.Return(_a0)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_UnprovisionDashboard_Call) RunAndReturn(run func(context.Context, int64) error) *FakeDashboardStore_UnprovisionDashboard_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// UpdateDashboardACL provides a mock function with given fields: ctx, uid, items
|
||||
func (_m *FakeDashboardStore) UpdateDashboardACL(ctx context.Context, uid int64, items []*DashboardACL) error {
|
||||
ret := _m.Called(ctx, uid, items)
|
||||
@ -1175,36 +476,6 @@ func (_m *FakeDashboardStore) UpdateDashboardACL(ctx context.Context, uid int64,
|
||||
return r0
|
||||
}
|
||||
|
||||
// FakeDashboardStore_UpdateDashboardACL_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDashboardACL'
|
||||
type FakeDashboardStore_UpdateDashboardACL_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// UpdateDashboardACL is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - uid int64
|
||||
// - items []*DashboardACL
|
||||
func (_e *FakeDashboardStore_Expecter) UpdateDashboardACL(ctx interface{}, uid interface{}, items interface{}) *FakeDashboardStore_UpdateDashboardACL_Call {
|
||||
return &FakeDashboardStore_UpdateDashboardACL_Call{Call: _e.mock.On("UpdateDashboardACL", ctx, uid, items)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_UpdateDashboardACL_Call) Run(run func(ctx context.Context, uid int64, items []*DashboardACL)) *FakeDashboardStore_UpdateDashboardACL_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(int64), args[2].([]*DashboardACL))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_UpdateDashboardACL_Call) Return(_a0 error) *FakeDashboardStore_UpdateDashboardACL_Call {
|
||||
_c.Call.Return(_a0)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_UpdateDashboardACL_Call) RunAndReturn(run func(context.Context, int64, []*DashboardACL) error) *FakeDashboardStore_UpdateDashboardACL_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ValidateDashboardBeforeSave provides a mock function with given fields: ctx, dashboard, overwrite
|
||||
func (_m *FakeDashboardStore) ValidateDashboardBeforeSave(ctx context.Context, dashboard *Dashboard, overwrite bool) (bool, error) {
|
||||
ret := _m.Called(ctx, dashboard, overwrite)
|
||||
@ -1229,36 +500,6 @@ func (_m *FakeDashboardStore) ValidateDashboardBeforeSave(ctx context.Context, d
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// FakeDashboardStore_ValidateDashboardBeforeSave_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidateDashboardBeforeSave'
|
||||
type FakeDashboardStore_ValidateDashboardBeforeSave_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// ValidateDashboardBeforeSave is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - dashboard *Dashboard
|
||||
// - overwrite bool
|
||||
func (_e *FakeDashboardStore_Expecter) ValidateDashboardBeforeSave(ctx interface{}, dashboard interface{}, overwrite interface{}) *FakeDashboardStore_ValidateDashboardBeforeSave_Call {
|
||||
return &FakeDashboardStore_ValidateDashboardBeforeSave_Call{Call: _e.mock.On("ValidateDashboardBeforeSave", ctx, dashboard, overwrite)}
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_ValidateDashboardBeforeSave_Call) Run(run func(ctx context.Context, dashboard *Dashboard, overwrite bool)) *FakeDashboardStore_ValidateDashboardBeforeSave_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*Dashboard), args[2].(bool))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_ValidateDashboardBeforeSave_Call) Return(_a0 bool, _a1 error) *FakeDashboardStore_ValidateDashboardBeforeSave_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FakeDashboardStore_ValidateDashboardBeforeSave_Call) RunAndReturn(run func(context.Context, *Dashboard, bool) (bool, error)) *FakeDashboardStore_ValidateDashboardBeforeSave_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
type mockConstructorTestingTNewFakeDashboardStore interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
|
Loading…
Reference in New Issue
Block a user