Update hasPermissions.js

This commit is contained in:
Mr Swift
2024-04-27 21:04:57 +03:30
parent bbd9a1fffb
commit 1b085e9767
-2
View File
@@ -1,7 +1,6 @@
const asyncHandler = require("express-async-handler");
const User = require("../models/userModels");
const hasPerma = (perm) => {
return asyncHandler(async (req, res, next) => {
const user = await User.findId(req.user.id)
@@ -13,5 +12,4 @@ const hasPerma = (perm) => {
})
}
module.exports = { name: "hasPermission", run: hasPerma };