mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Connections: Make "Connect data" a section title (#61144)
* Wip * Fix: change tests to cater for the new scenario * feat(Connections): redirect to "Your connections / Datasources" if cannot admin plugins
This commit is contained in:
@@ -569,6 +569,19 @@ func (s *ServiceImpl) buildDataConnectionsNavLink(c *models.ReqContext) *navtree
|
||||
|
||||
baseUrl := s.cfg.AppSubURL + "/connections"
|
||||
|
||||
// Connect data
|
||||
// FIXME: while we don't have a permissions for listing plugins the legacy check has to stay as a default
|
||||
if plugins.ReqCanAdminPlugins(s.cfg)(c) || hasAccess(plugins.ReqCanAdminPlugins(s.cfg), plugins.AdminAccessEvaluator) {
|
||||
children = append(children, &navtree.NavLink{
|
||||
Id: "connections-connect-data",
|
||||
Text: "Connect data",
|
||||
SubTitle: "Browse and create new connections",
|
||||
IsSection: true,
|
||||
Url: s.cfg.AppSubURL + "/connections/connect-data",
|
||||
Children: []*navtree.NavLink{},
|
||||
})
|
||||
}
|
||||
|
||||
if hasAccess(ac.ReqOrgAdmin, datasources.ConfigurationPageAccess) {
|
||||
// Your connections
|
||||
children = append(children, &navtree.NavLink{
|
||||
@@ -586,18 +599,6 @@ func (s *ServiceImpl) buildDataConnectionsNavLink(c *models.ReqContext) *navtree
|
||||
})
|
||||
}
|
||||
|
||||
// Connect data
|
||||
// FIXME: while we don't have a permissions for listing plugins the legacy check has to stay as a default
|
||||
if plugins.ReqCanAdminPlugins(s.cfg)(c) || hasAccess(plugins.ReqCanAdminPlugins(s.cfg), plugins.AdminAccessEvaluator) {
|
||||
children = append(children, &navtree.NavLink{
|
||||
Id: "connections-connect-data",
|
||||
Text: "Connect data",
|
||||
SubTitle: "Browse and create new connections",
|
||||
Url: s.cfg.AppSubURL + "/connections/connect-data",
|
||||
Children: []*navtree.NavLink{},
|
||||
})
|
||||
}
|
||||
|
||||
if len(children) > 0 {
|
||||
// Connections (main)
|
||||
navLink = &navtree.NavLink{
|
||||
|
||||
Reference in New Issue
Block a user