diff --git a/grafana b/grafana index cf344abff2c..5b93e09714d 160000 --- a/grafana +++ b/grafana @@ -1 +1 @@ -Subproject commit cf344abff2cdf7638d1748aa698caf23c3848715 +Subproject commit 5b93e09714dbee6c1c181daf0182704334d8c6be diff --git a/pkg/api/api.go b/pkg/api/api.go index 3d4f7e0e9c6..44e44600292 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -10,7 +10,7 @@ import ( // Register adds http routes func Register(m *macaron.Macaron) { reqSignedIn := middleware.Auth(&middleware.AuthOptions{ReqSignedIn: true}) - reqAdmin := middleware.Auth(&middleware.AuthOptions{ReqSignedIn: true, ReqAdmin: false}) + reqAdmin := middleware.Auth(&middleware.AuthOptions{ReqSignedIn: true, ReqAdmin: true}) // not logged in views m.Get("/", reqSignedIn, Index) diff --git a/pkg/models/account.go b/pkg/models/account.go index 5e9f507c578..e2bc96e8021 100644 --- a/pkg/models/account.go +++ b/pkg/models/account.go @@ -95,9 +95,11 @@ type CollaboratorDTO struct { } type AccountSearchHitDTO struct { - Id int64 `json:"id"` - Name string `json:"name"` - Email string `json:"email"` + Id int64 `json:"id"` + Name string `json:"name"` + Login string `json:"login"` + Email string `json:"email"` + IsAdmin bool `json:"isAdmin"` } type AccountDTO struct { diff --git a/pkg/services/sqlstore/accounts.go b/pkg/services/sqlstore/accounts.go index f0e91dc2169..61a445a7275 100644 --- a/pkg/services/sqlstore/accounts.go +++ b/pkg/services/sqlstore/accounts.go @@ -188,7 +188,7 @@ func SearchAccounts(query *m.SearchAccountsQuery) error { sess := x.Table("account") sess.Where("email LIKE ?", query.Query+"%") sess.Limit(query.Limit, query.Limit*query.Page) - sess.Cols("id", "email", "name") + sess.Cols("id", "email", "name", "login", "is_admin") err := sess.Find(&query.Result) return err