From e7c43bf614ae380c99f9cf09b4bdbb100088efad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 29 Apr 2015 09:26:12 +0200 Subject: [PATCH] expose org id to frontend, Closes #1907 --- pkg/api/dtos/models.go | 3 ++- pkg/api/index.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/api/dtos/models.go b/pkg/api/dtos/models.go index 0057f78ff0d..fea88f07550 100644 --- a/pkg/api/dtos/models.go +++ b/pkg/api/dtos/models.go @@ -21,8 +21,9 @@ type CurrentUser struct { Email string `json:"email"` Name string `json:"name"` LightTheme bool `json:"lightTheme"` - OrgRole m.RoleType `json:"orgRole"` + OrgId int64 `json:"orgId"` OrgName string `json:"orgName"` + OrgRole m.RoleType `json:"orgRole"` IsGrafanaAdmin bool `json:"isGrafanaAdmin"` GravatarUrl string `json:"gravatarUrl"` } diff --git a/pkg/api/index.go b/pkg/api/index.go index d9ecf65b699..86a5e3f1882 100644 --- a/pkg/api/index.go +++ b/pkg/api/index.go @@ -18,6 +18,7 @@ func setIndexViewData(c *middleware.Context) error { Email: c.Email, Name: c.Name, LightTheme: c.Theme == "light", + OrgId: c.OrgId, OrgName: c.OrgName, OrgRole: c.OrgRole, GravatarUrl: dtos.GetGravatarUrl(c.Email),