Chore: Add Usage stats providers registry (#48357)

* add usage stats providers

* migrate thumbnails service to `registry.ProvidesUsageStats`

* snake -> camel

* lint fix

* migrate accesscontrol to `registry.ProvidesUsageStats`

* add accesscontrol to usage stats providers registry

* fix test

* added a note about errors
This commit is contained in:
Artur Wierzbicki
2022-04-28 13:06:49 +04:00
committed by GitHub
parent ff23f78b51
commit 736be74128
13 changed files with 123 additions and 39 deletions
@@ -6,6 +6,7 @@ import (
"strings"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/registry"
)
type Options struct {
@@ -13,6 +14,8 @@ type Options struct {
}
type AccessControl interface {
registry.ProvidesUsageStats
// Evaluate evaluates access to the given resources.
Evaluate(ctx context.Context, user *models.SignedInUser, evaluator Evaluator) (bool, error)