bd2b248f0e
* 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) {}
|