summaryrefslogtreecommitdiffstats
path: root/api/general.go
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2017-09-06 16:24:34 -0400
committerJoramWilander <jwawilander@gmail.com>2017-09-06 16:24:34 -0400
commitd38328976e2c8bb0fab91e656042a0d8ac37bc76 (patch)
tree7e3d1a96a007accfcea499857541f96890846122 /api/general.go
parentf968c56890bd84295672ee0d46cc846cac2dbd47 (diff)
downloadchat-d38328976e2c8bb0fab91e656042a0d8ac37bc76.tar.gz
chat-d38328976e2c8bb0fab91e656042a0d8ac37bc76.tar.bz2
chat-d38328976e2c8bb0fab91e656042a0d8ac37bc76.zip
Various patches
Diffstat (limited to 'api/general.go')
-rw-r--r--api/general.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/api/general.go b/api/general.go
index 16a739704..ceb0b209f 100644
--- a/api/general.go
+++ b/api/general.go
@@ -10,6 +10,7 @@ import (
l4g "github.com/alecthomas/log4go"
+ "github.com/mattermost/platform/app"
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils"
)
@@ -30,7 +31,14 @@ func logClient(c *Context, w http.ResponseWriter, r *http.Request) {
forceToDebug := false
if !*utils.Cfg.ServiceSettings.EnableDeveloper {
- forceToDebug = true
+ if c.Session.UserId == "" {
+ c.Err = model.NewAppError("Permissions", "api.context.permissions.app_error", nil, "", http.StatusForbidden)
+ return
+ }
+
+ if !app.SessionHasPermissionTo(c.Session, model.PERMISSION_MANAGE_SYSTEM) {
+ forceToDebug = true
+ }
}
m := model.MapFromJson(r.Body)