permissions: removes global access to bus from MakeUserAdmin.

This commit is contained in:
Leonard Gram
2019-03-19 14:01:20 +01:00
parent adf0390b2c
commit a615b78f8a
4 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -16,7 +16,7 @@ func (hs *HTTPServer) CreateTeam(c *m.ReqContext, cmd m.CreateTeamCommand) Respo
return Error(403, "Not allowed to create team.", nil)
}
if err := bus.Dispatch(&cmd); err != nil {
if err := hs.Bus.Dispatch(&cmd); err != nil {
if err == m.ErrTeamNameTaken {
return Error(409, "Team name taken", err)
}
@@ -31,7 +31,7 @@ func (hs *HTTPServer) CreateTeam(c *m.ReqContext, cmd m.CreateTeamCommand) Respo
Permission: m.PERMISSION_ADMIN,
}
if err := bus.Dispatch(&addMemberCmd); err != nil {
if err := hs.Bus.Dispatch(&addMemberCmd); err != nil {
c.Logger.Error("Could not add creator to team.", "error", err)
}
}