From af1068ce1d1ca7ecaea5789ece1566987ce712ef Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 7 Oct 2016 15:32:09 +0200 Subject: Server: forbid to remove the root user --- server/middlewares/validators/users.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'server/middlewares') diff --git a/server/middlewares/validators/users.js b/server/middlewares/validators/users.js index d541e9124..02e4f34cb 100644 --- a/server/middlewares/validators/users.js +++ b/server/middlewares/validators/users.js @@ -47,6 +47,8 @@ function usersRemove (req, res, next) { if (!user) return res.status(404).send('User not found') + if (user.username === 'root') return res.status(400).send('Cannot remove the root user') + next() }) }) -- cgit v1.2.3