RBAC: Refactor RBAC plugin interface code (#90679)

move plugin RBAC registration ifaces to pluginsintegrations
This commit is contained in:
Ieva
2024-07-22 09:31:36 +01:00
committed by GitHub
parent 63cc01fe80
commit 4c7d8c8cdd
9 changed files with 34 additions and 26 deletions
+2 -1
View File
@@ -30,11 +30,12 @@ import (
"github.com/grafana/grafana/pkg/services/dashboards"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/folder"
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginaccesscontrol"
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/setting"
)
var _ plugins.RoleRegistry = &Service{}
var _ pluginaccesscontrol.RoleRegistry = &Service{}
const (
cacheTTL = 60 * time.Second
+2 -1
View File
@@ -8,13 +8,14 @@ import (
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/services/accesscontrol"
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginaccesscontrol"
"github.com/grafana/grafana/pkg/services/user"
)
type fullAccessControl interface {
accesscontrol.AccessControl
accesscontrol.Service
plugins.RoleRegistry
pluginaccesscontrol.RoleRegistry
RegisterFixedRoles(context.Context) error
}
@@ -12,18 +12,18 @@ import (
"github.com/grafana/grafana/pkg/apimachinery/identity"
"github.com/grafana/grafana/pkg/infra/db"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/services/accesscontrol"
"github.com/grafana/grafana/pkg/services/dashboards"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/licensing"
"github.com/grafana/grafana/pkg/services/org"
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginaccesscontrol"
"github.com/grafana/grafana/pkg/services/team"
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/setting"
)
var _ plugins.ActionSetRegistry = (*InMemoryActionSets)(nil)
var _ pluginaccesscontrol.ActionSetRegistry = (*InMemoryActionSets)(nil)
type Store interface {
// SetUserResourcePermission sets permission for managed user role on a resource
@@ -440,7 +440,7 @@ type ActionSetService interface {
StoreActionSet(name string, actions []string)
plugins.ActionSetRegistry
pluginaccesscontrol.ActionSetRegistry
}
// ActionSet is a struct that represents a set of actions that can be performed on a resource.