teams: viewers and editors can view teams
This commit is contained in:
committed by
Leonard Gram
parent
c420af16b1
commit
782b5b6a3a
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user