mirror of
https://github.com/grafana/grafana.git
synced 2024-12-02 13:39:19 -06:00
8cea8fdaea
* Implement GetHiddenACL to handle legacy api correctly
40 lines
1.0 KiB
Go
40 lines
1.0 KiB
Go
package mock
|
|
|
|
import (
|
|
"github.com/grafana/grafana/pkg/services/accesscontrol"
|
|
)
|
|
|
|
var _ accesscontrol.PermissionsServices = new(PermissionsServicesMock)
|
|
|
|
func NewPermissionsServicesMock() *PermissionsServicesMock {
|
|
return &PermissionsServicesMock{
|
|
Teams: &MockPermissionsService{},
|
|
Folders: &MockPermissionsService{},
|
|
Dashboards: &MockPermissionsService{},
|
|
Datasources: &MockPermissionsService{},
|
|
}
|
|
}
|
|
|
|
type PermissionsServicesMock struct {
|
|
Teams *MockPermissionsService
|
|
Folders *MockPermissionsService
|
|
Dashboards *MockPermissionsService
|
|
Datasources *MockPermissionsService
|
|
}
|
|
|
|
func (p PermissionsServicesMock) GetTeamService() accesscontrol.PermissionsService {
|
|
return p.Teams
|
|
}
|
|
|
|
func (p PermissionsServicesMock) GetFolderService() accesscontrol.PermissionsService {
|
|
return p.Folders
|
|
}
|
|
|
|
func (p PermissionsServicesMock) GetDashboardService() accesscontrol.PermissionsService {
|
|
return p.Dashboards
|
|
}
|
|
|
|
func (p PermissionsServicesMock) GetDataSourceService() accesscontrol.PermissionsService {
|
|
return p.Datasources
|
|
}
|