From 5f6663675f1fa6589cacfcd137a01a914269a22c Mon Sep 17 00:00:00 2001 From: James Ketrenos Date: Sat, 6 Oct 2018 16:05:52 -0700 Subject: [PATCH] Only allow maintainers to initiate a scan Signed-off-by: James Ketrenos --- server/routes/scan.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/routes/scan.js b/server/routes/scan.js index 6955e9a..b3b2caa 100644 --- a/server/routes/scan.js +++ b/server/routes/scan.js @@ -16,7 +16,11 @@ const router = express.Router(); let scanner = null; router.get("/", function(req, res/*, next*/) { - console.log("Scanning."); + console.log("/scan."); + + if (!req.user.maintainer) { + return res.status(401).send("Only maintainers can start a scan"); + } let responded = false;