mirror of
https://github.com/zoriya/flood.git
synced 2026-06-02 02:56:05 +00:00
User management: disable Authentication tab content for non admin users (#718)
* User management: first commit * User management: remove wrong setState * User management: remove debug log * lint * format * cr fixes * refactor from services to middleware * remove userService.js
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
module.exports = (req, res, next) => {
|
||||
if (req.user == null || !req.user.isAdmin) {
|
||||
return res
|
||||
.status(403)
|
||||
.json({message: 'User is not admin.'})
|
||||
.send();
|
||||
}
|
||||
next();
|
||||
};
|
||||
Reference in New Issue
Block a user