teams: viewers and editors can view teams

This commit is contained in:
Hugo Häggmark
2019-03-13 10:38:09 +01:00
committed by Leonard Gram
parent c420af16b1
commit 782b5b6a3a
5 changed files with 15 additions and 22 deletions
+5
View File
@@ -11,6 +11,11 @@ import (
// POST /api/teams
func (hs *HTTPServer) CreateTeam(c *m.ReqContext, cmd m.CreateTeamCommand) Response {
cmd.OrgId = c.OrgId
if c.OrgRole == m.ROLE_VIEWER {
return Error(403, "Not allowed to create team.", nil)
}
if err := bus.Dispatch(&cmd); err != nil {
if err == m.ErrTeamNameTaken {
return Error(409, "Team name taken", err)