feat: add disable exec flag (#1090)

This commit is contained in:
Keagan McClelland
2020-10-01 08:45:24 -06:00
committed by GitHub
parent 1529e796df
commit 97693cc611
14 changed files with 53 additions and 28 deletions

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)
}