Provisioning: Show in NavTree based on org role, not access control (#104599)

pull/104403/head^2
Ryan McKinley 3 weeks ago committed by GitHub
parent 645af8df33
commit 3a8575ea1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 11
      pkg/services/navtree/navtreeimpl/admin.go
  2. 5
      public/app/features/provisioning/GettingStarted/GettingStarted.tsx

@ -1,6 +1,7 @@
package navtreeimpl
import (
"github.com/grafana/grafana/pkg/apimachinery/identity"
"github.com/grafana/grafana/pkg/login/social"
ac "github.com/grafana/grafana/pkg/services/accesscontrol"
"github.com/grafana/grafana/pkg/services/accesscontrol/ssoutils"
@ -60,15 +61,15 @@ func (s *ServiceImpl) getAdminNode(c *contextmodel.ReqContext) (*navtree.NavLink
Url: s.cfg.AppSubURL + "/admin/migrate-to-cloud",
})
}
if hasAccess(ac.EvalPermission(ac.ActionSettingsRead, ac.ScopeSettingsAll)) {
provisioningNode := &navtree.NavLink{
if c.HasRole(identity.RoleAdmin) &&
(s.cfg.StackID == "" || // show OnPrem even when provisioning is disabled
s.features.IsEnabledGlobally(featuremgmt.FlagProvisioning)) {
configNodes = append(configNodes, &navtree.NavLink{
Text: "Provisioning",
Id: "provisioning",
SubTitle: "View and manage your provisioning connections",
Url: s.cfg.AppSubURL + "/admin/provisioning",
}
configNodes = append(configNodes, provisioningNode)
})
}
generalNode := &navtree.NavLink{

@ -18,11 +18,8 @@ const featureIni = `# In your custom.ini file
[feature_toggles]
provisioning = true
kubernetesClientDashboardsFolders = true
kubernetesDashboards = true ; use k8s from browser
# If you want easy kubectl setup development mode
grafanaAPIServerEnsureKubectlAccess = true`;
`;
const ngrokExample = `ngrok http 3000

Loading…
Cancel
Save