feat: add disable exec flag (#1090)

This commit is contained in:
Keagan McClelland authored and GitHub committed 2020-10-01 16:45:24 +02:00
1 parent 1529e796df
commit 97693cc611
14 files changed
+53 -28

No files matched your search

+1 -1
View File
@@ -59,7 +59,7 @@ var commandsHandler = withUser(func(w http.ResponseWriter, r *http.Request, d *d
}
}
if !d.user.CanExecute(strings.Split(raw, " ")[0]) {
if !d.server.EnableExec || !d.user.CanExecute(strings.Split(raw, " ")[0]) {
if err := conn.WriteMessage(websocket.TextMessage, cmdNotAllowed); err != nil { //nolint:shadow
wsErr(conn, r, http.StatusInternalServerError, err)
}