mirror of
https://github.com/grafana/grafana.git
synced 2025-07-31 17:02:14 +08:00
Provisioning: Show in NavTree based on org role, not access control (#104599)
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
package navtreeimpl
|
package navtreeimpl
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/grafana/grafana/pkg/apimachinery/identity"
|
||||||
"github.com/grafana/grafana/pkg/login/social"
|
"github.com/grafana/grafana/pkg/login/social"
|
||||||
ac "github.com/grafana/grafana/pkg/services/accesscontrol"
|
ac "github.com/grafana/grafana/pkg/services/accesscontrol"
|
||||||
"github.com/grafana/grafana/pkg/services/accesscontrol/ssoutils"
|
"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",
|
Url: s.cfg.AppSubURL + "/admin/migrate-to-cloud",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if hasAccess(ac.EvalPermission(ac.ActionSettingsRead, ac.ScopeSettingsAll)) {
|
if c.HasRole(identity.RoleAdmin) &&
|
||||||
provisioningNode := &navtree.NavLink{
|
(s.cfg.StackID == "" || // show OnPrem even when provisioning is disabled
|
||||||
|
s.features.IsEnabledGlobally(featuremgmt.FlagProvisioning)) {
|
||||||
|
configNodes = append(configNodes, &navtree.NavLink{
|
||||||
Text: "Provisioning",
|
Text: "Provisioning",
|
||||||
Id: "provisioning",
|
Id: "provisioning",
|
||||||
SubTitle: "View and manage your provisioning connections",
|
SubTitle: "View and manage your provisioning connections",
|
||||||
Url: s.cfg.AppSubURL + "/admin/provisioning",
|
Url: s.cfg.AppSubURL + "/admin/provisioning",
|
||||||
}
|
})
|
||||||
|
|
||||||
configNodes = append(configNodes, provisioningNode)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
generalNode := &navtree.NavLink{
|
generalNode := &navtree.NavLink{
|
||||||
|
@ -18,11 +18,8 @@ const featureIni = `# In your custom.ini file
|
|||||||
|
|
||||||
[feature_toggles]
|
[feature_toggles]
|
||||||
provisioning = true
|
provisioning = true
|
||||||
kubernetesClientDashboardsFolders = true
|
|
||||||
kubernetesDashboards = true ; use k8s from browser
|
kubernetesDashboards = true ; use k8s from browser
|
||||||
|
`;
|
||||||
# If you want easy kubectl setup development mode
|
|
||||||
grafanaAPIServerEnsureKubectlAccess = true`;
|
|
||||||
|
|
||||||
const ngrokExample = `ngrok http 3000
|
const ngrokExample = `ngrok http 3000
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user