mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-10 16:05:49 +01:00
refactor: remove usage of middlewares
Specifically, middleware.isAdmin|exposePrivilegeSet|exposePrivileges
This commit is contained in:
@@ -201,6 +201,7 @@ module.exports = function (middleware) {
|
||||
|
||||
middleware.isAdmin = helpers.try(async function isAdmin(req, res, next) {
|
||||
const isAdmin = await user.isAdministrator(req.uid);
|
||||
|
||||
if (!isAdmin) {
|
||||
return controllers.helpers.notAllowed(req, res);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user