mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* remove unused action set code, refactor the existing code * fix import ordering * use a separate interface for permission expansion after all, to avoid circular dependencies * add comments, fix a test
25 lines
701 B
Go
25 lines
701 B
Go
package resourcepermissions
|
|
|
|
import "github.com/grafana/grafana/pkg/services/accesscontrol"
|
|
|
|
type FakeActionSetSvc struct {
|
|
ExpectedErr error
|
|
ExpectedActionSets []string
|
|
ExpectedActions []string
|
|
ExpectedPermissions []accesscontrol.Permission
|
|
}
|
|
|
|
func (f *FakeActionSetSvc) ResolveAction(action string) []string {
|
|
return f.ExpectedActionSets
|
|
}
|
|
|
|
func (f *FakeActionSetSvc) ResolveActionSet(actionSet string) []string {
|
|
return f.ExpectedActions
|
|
}
|
|
|
|
func (f *FakeActionSetSvc) ExpandActionSets(permissions []accesscontrol.Permission) []accesscontrol.Permission {
|
|
return f.ExpectedPermissions
|
|
}
|
|
|
|
func (f *FakeActionSetSvc) StoreActionSet(resource, permission string, actions []string) {}
|