From 81636d8634fa21f60a867ca4a11a270df883d473 Mon Sep 17 00:00:00 2001 From: Anthony Woods Date: Wed, 29 Apr 2015 15:14:49 +0800 Subject: [PATCH] expose orgId via currentUser object. fixes #1907 --- pkg/api/dtos/models.go | 1 + pkg/api/index.go | 1 + 2 files changed, 2 insertions(+) diff --git a/pkg/api/dtos/models.go b/pkg/api/dtos/models.go index 0057f78ff0d..a14ff55c079 100644 --- a/pkg/api/dtos/models.go +++ b/pkg/api/dtos/models.go @@ -23,6 +23,7 @@ type CurrentUser struct { LightTheme bool `json:"lightTheme"` OrgRole m.RoleType `json:"orgRole"` OrgName string `json:"orgName"` + OrgId int64 `json:"orgId"` IsGrafanaAdmin bool `json:"isGrafanaAdmin"` GravatarUrl string `json:"gravatarUrl"` } diff --git a/pkg/api/index.go b/pkg/api/index.go index d9ecf65b699..6e880b1d066 100644 --- a/pkg/api/index.go +++ b/pkg/api/index.go @@ -20,6 +20,7 @@ func setIndexViewData(c *middleware.Context) error { LightTheme: c.Theme == "light", OrgName: c.OrgName, OrgRole: c.OrgRole, + OrgId: c.OrgId, GravatarUrl: dtos.GetGravatarUrl(c.Email), IsGrafanaAdmin: c.IsGrafanaAdmin, }