|
|
@@ -92,17 +92,22 @@ func setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, error) {
|
|
|
data.Theme = "light"
|
|
|
}
|
|
|
|
|
|
- if c.OrgRole == m.ROLE_ADMIN || c.OrgRole == m.ROLE_EDITOR {
|
|
|
+ if hasEditPermissionInFoldersQuery.Result {
|
|
|
+ children := []*dtos.NavLink{
|
|
|
+ {Text: "Dashboard", Icon: "gicon gicon-dashboard-new", Url: setting.AppSubUrl + "/dashboard/new"},
|
|
|
+ }
|
|
|
+
|
|
|
+ if c.OrgRole == m.ROLE_ADMIN || c.OrgRole == m.ROLE_EDITOR {
|
|
|
+ children = append(children, &dtos.NavLink{Text: "Folder", SubTitle: "Create a new folder to organize your dashboards", Id: "folder", Icon: "gicon gicon-folder-new", Url: setting.AppSubUrl + "/dashboards/folder/new"})
|
|
|
+ children = append(children, &dtos.NavLink{Text: "Import", SubTitle: "Import dashboard from file or Grafana.com", Id: "import", Icon: "gicon gicon-dashboard-import", Url: setting.AppSubUrl + "/dashboard/import"})
|
|
|
+ }
|
|
|
+
|
|
|
data.NavTree = append(data.NavTree, &dtos.NavLink{
|
|
|
- Text: "Create",
|
|
|
- Id: "create",
|
|
|
- Icon: "fa fa-fw fa-plus",
|
|
|
- Url: setting.AppSubUrl + "/dashboard/new",
|
|
|
- Children: []*dtos.NavLink{
|
|
|
- {Text: "Dashboard", Icon: "gicon gicon-dashboard-new", Url: setting.AppSubUrl + "/dashboard/new"},
|
|
|
- {Text: "Folder", SubTitle: "Create a new folder to organize your dashboards", Id: "folder", Icon: "gicon gicon-folder-new", Url: setting.AppSubUrl + "/dashboards/folder/new"},
|
|
|
- {Text: "Import", SubTitle: "Import dashboard from file or Grafana.com", Id: "import", Icon: "gicon gicon-dashboard-import", Url: setting.AppSubUrl + "/dashboard/import"},
|
|
|
- },
|
|
|
+ Text: "Create",
|
|
|
+ Id: "create",
|
|
|
+ Icon: "fa fa-fw fa-plus",
|
|
|
+ Url: setting.AppSubUrl + "/dashboard/new",
|
|
|
+ Children: children,
|
|
|
})
|
|
|
}
|
|
|
|