Update hasPermissions.js
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
const asyncHandler = require("express-async-handler");
|
const asyncHandler = require("express-async-handler");
|
||||||
const User = require("../models/userModels");
|
const User = require("../models/userModels");
|
||||||
|
|
||||||
|
|
||||||
const hasPerma = (perm) => {
|
const hasPerma = (perm) => {
|
||||||
return asyncHandler(async (req, res, next) => {
|
return asyncHandler(async (req, res, next) => {
|
||||||
const user = await User.findId(req.user.id)
|
const user = await User.findId(req.user.id)
|
||||||
@@ -13,5 +12,4 @@ const hasPerma = (perm) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
module.exports = { name: "hasPermission", run: hasPerma };
|
module.exports = { name: "hasPermission", run: hasPerma };
|
||||||
Reference in New Issue
Block a user