mirror of
https://github.com/grafana/grafana.git
synced 2025-02-14 17:43:35 -06:00
* [WIP] Lift RBAC from xorm store * Cleanup RBAC, fix tests * Use the scope type map as a map * Remove dependency on dashboard service * Make dashboards a map for constant time lookups (useful later) --- * Lift RBAC tests into a new file to test at service level * Add necessary access resource structs to xorm store tests * Move authorization into separate service * Pass features to searchstore.Builder * Sort imports * Code cleanup * Remove useless scope type check * Lift permission check into `Authorize()` * Use clearer language when checking scope types * Include dashboard permissions in test to ensure they're ignored * Switch to errutil * Cleanup sql.Cfg refs
22 lines
901 B
Go
22 lines
901 B
Go
package annotationsimpl
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/grafana/grafana/pkg/services/annotations/accesscontrol"
|
|
|
|
"github.com/grafana/grafana/pkg/services/annotations"
|
|
"github.com/grafana/grafana/pkg/setting"
|
|
)
|
|
|
|
type store interface {
|
|
Add(ctx context.Context, items *annotations.Item) error
|
|
AddMany(ctx context.Context, items []annotations.Item) error
|
|
Update(ctx context.Context, item *annotations.Item) error
|
|
Get(ctx context.Context, query *annotations.ItemQuery, accessResources *accesscontrol.AccessResources) ([]*annotations.ItemDTO, error)
|
|
Delete(ctx context.Context, params *annotations.DeleteParams) error
|
|
GetTags(ctx context.Context, query *annotations.TagsQuery) (annotations.FindTagsResult, error)
|
|
CleanAnnotations(ctx context.Context, cfg setting.AnnotationCleanupSettings, annotationType string) (int64, error)
|
|
CleanOrphanedAnnotationTags(ctx context.Context) (int64, error)
|
|
}
|