teams: show teams and plugins for editors that can own

This commit is contained in:
Hugo Häggmark 2019-03-06 08:40:42 +01:00 committed by Leonard Gram
parent 124fb743e8
commit efbd93f824
2 changed files with 29 additions and 1 deletions

View File

@ -143,7 +143,7 @@ func createFolderScenario(desc string, url string, routePattern string, mock *fa
defer bus.ClearBusHandlers()
cfg := setting.NewCfg()
cfg.EditorsCanOwn = false
cfg.EditorsCanOwn = true
hs := HTTPServer{
Bus: bus.GetBus(),

View File

@ -327,6 +327,34 @@ func (hs *HTTPServer) setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, er
})
}
if c.OrgRole == m.ROLE_EDITOR && hs.Cfg.EditorsCanOwn {
cfgNode := &dtos.NavLink{
Id: "cfg",
Text: "Configuration",
SubTitle: "Organization: " + c.OrgName,
Icon: "gicon gicon-cog",
Url: setting.AppSubUrl + "/org/teams",
Children: []*dtos.NavLink{
{
Text: "Teams",
Id: "teams",
Description: "Manage org groups",
Icon: "gicon gicon-team",
Url: setting.AppSubUrl + "/org/teams",
},
{
Text: "Plugins",
Id: "plugins",
Description: "View and configure plugins",
Icon: "gicon gicon-plugins",
Url: setting.AppSubUrl + "/plugins",
},
},
}
data.NavTree = append(data.NavTree, cfgNode)
}
data.NavTree = append(data.NavTree, &dtos.NavLink{
Text: "Help",
SubTitle: fmt.Sprintf(`%s v%s (%s)`, setting.ApplicationName, setting.BuildVersion, setting.BuildCommit),