diff options
author | =Corey Hulen <corey@hulen.com> | 2016-02-01 18:52:43 -0800 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2016-02-01 18:52:43 -0800 |
commit | 27586a320add265f3e032d2cb21b27e93b51a2b0 (patch) | |
tree | 5158d1ffeb0f3a922b0036f560b3c99862373275 /api/webhook.go | |
parent | b4ec6900510077253290e361d1a706e5368a45de (diff) | |
download | chat-27586a320add265f3e032d2cb21b27e93b51a2b0.tar.gz chat-27586a320add265f3e032d2cb21b27e93b51a2b0.tar.bz2 chat-27586a320add265f3e032d2cb21b27e93b51a2b0.zip |
Adding loc to new command backend
Diffstat (limited to 'api/webhook.go')
-rw-r--r-- | api/webhook.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/api/webhook.go b/api/webhook.go index 399f62fdb..3906d09be 100644 --- a/api/webhook.go +++ b/api/webhook.go @@ -34,7 +34,7 @@ func createIncomingHook(c *Context, w http.ResponseWriter, r *http.Request) { if *utils.Cfg.ServiceSettings.EnableOnlyAdminIntegrations { if !(c.IsSystemAdmin() || c.IsTeamAdmin()) { - c.Err = model.NewAppError("createCommand", "Integrations have been limited to admins only.", "") + c.Err = model.NewLocAppError("createIncomingHook", "api.command.admin_only.app_error", nil, "") c.Err.StatusCode = http.StatusForbidden return } @@ -89,7 +89,7 @@ func deleteIncomingHook(c *Context, w http.ResponseWriter, r *http.Request) { if *utils.Cfg.ServiceSettings.EnableOnlyAdminIntegrations { if !(c.IsSystemAdmin() || c.IsTeamAdmin()) { - c.Err = model.NewAppError("createCommand", "Integrations have been limited to admins only.", "") + c.Err = model.NewLocAppError("deleteIncomingHook", "api.command.admin_only.app_error", nil, "") c.Err.StatusCode = http.StatusForbidden return } @@ -134,7 +134,7 @@ func getIncomingHooks(c *Context, w http.ResponseWriter, r *http.Request) { if *utils.Cfg.ServiceSettings.EnableOnlyAdminIntegrations { if !(c.IsSystemAdmin() || c.IsTeamAdmin()) { - c.Err = model.NewAppError("createCommand", "Integrations have been limited to admins only.", "") + c.Err = model.NewLocAppError("getIncomingHooks", "api.command.admin_only.app_error", nil, "") c.Err.StatusCode = http.StatusForbidden return } @@ -158,7 +158,7 @@ func createOutgoingHook(c *Context, w http.ResponseWriter, r *http.Request) { if *utils.Cfg.ServiceSettings.EnableOnlyAdminIntegrations { if !(c.IsSystemAdmin() || c.IsTeamAdmin()) { - c.Err = model.NewAppError("createCommand", "Integrations have been limited to admins only.", "") + c.Err = model.NewLocAppError("createOutgoingHook", "api.command.admin_only.app_error", nil, "") c.Err.StatusCode = http.StatusForbidden return } @@ -222,7 +222,7 @@ func getOutgoingHooks(c *Context, w http.ResponseWriter, r *http.Request) { if *utils.Cfg.ServiceSettings.EnableOnlyAdminIntegrations { if !(c.IsSystemAdmin() || c.IsTeamAdmin()) { - c.Err = model.NewAppError("createCommand", "Integrations have been limited to admins only.", "") + c.Err = model.NewLocAppError("getOutgoingHooks", "api.command.admin_only.app_error", nil, "") c.Err.StatusCode = http.StatusForbidden return } @@ -246,7 +246,7 @@ func deleteOutgoingHook(c *Context, w http.ResponseWriter, r *http.Request) { if *utils.Cfg.ServiceSettings.EnableOnlyAdminIntegrations { if !(c.IsSystemAdmin() || c.IsTeamAdmin()) { - c.Err = model.NewAppError("createCommand", "Integrations have been limited to admins only.", "") + c.Err = model.NewLocAppError("deleteOutgoingHook", "api.command.admin_only.app_error", nil, "") c.Err.StatusCode = http.StatusForbidden return } @@ -291,7 +291,7 @@ func regenOutgoingHookToken(c *Context, w http.ResponseWriter, r *http.Request) if *utils.Cfg.ServiceSettings.EnableOnlyAdminIntegrations { if !(c.IsSystemAdmin() || c.IsTeamAdmin()) { - c.Err = model.NewAppError("createCommand", "Integrations have been limited to admins only.", "") + c.Err = model.NewLocAppError("regenOutgoingHookToken", "api.command.admin_only.app_error", nil, "") c.Err.StatusCode = http.StatusForbidden return } |