refactor: remove usage of middlewares

Specifically, middleware.isAdmin|exposePrivilegeSet|exposePrivileges
This commit is contained in:
Julian Lam
2020-10-29 07:56:28 -04:00
parent bff53de03f
commit 266d7587b2
8 changed files with 50 additions and 19 deletions

View File

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