FIX: Bugs

This commit is contained in:
2025-04-19 23:33:11 +03:30
parent 6367325622
commit 0fe0587846
7 changed files with 52 additions and 23 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ const requires = (...permissions) => {
if (
!checker(rolePerm, perm?._id) &&
!checker(userPerm, perm?._id) &&
role._id.toString() !== process.env.SUPER_ADMIN_ID
role._id.toString() !== process.env.SUPER_ADMIN_ROLE_ID
) {
throw new AppError('NoPermissionAccess', 403, {})
}
@@ -50,7 +50,7 @@ const adminCheck = () => {
if (
!checker(rolePerm, perm?._id) &&
!checker(userPerm, perm?._id) &&
user.role?._id.toString() !== process.env.SUPER_ADMIN_ID
user.role?._id.toString() !== process.env.SUPER_ADMIN_ROLE_ID
) {
throw new AppError('NoPermissionAccess', 403, {})
}