Plugins: Change managed plugins installation call (#77120)

This commit is contained in:
Hugo Kiyodi Oshiro
2023-11-10 12:28:36 +01:00
committed by GitHub
parent 6097ff255c
commit e754c5a6c6
12 changed files with 95 additions and 33 deletions

View File

@@ -3,6 +3,7 @@ package pluginaccesscontrol
import (
ac "github.com/grafana/grafana/pkg/services/accesscontrol"
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/org"
"github.com/grafana/grafana/pkg/setting"
)
@@ -67,7 +68,8 @@ func DeclareRBACRoles(service ac.Service, cfg *setting.Cfg) error {
Grants: []string{ac.RoleGrafanaAdmin},
}
if !cfg.PluginAdminEnabled || cfg.PluginAdminExternalManageEnabled {
if !cfg.PluginAdminEnabled ||
(cfg.PluginAdminExternalManageEnabled && !cfg.IsFeatureToggleEnabled(featuremgmt.FlagManagedPluginsInstall)) {
PluginsMaintainer.Grants = []string{}
}