Check for superadmin as opposed to admin
This commit is contained in:
1 parent
4b2973e308
commit
ef02bd8078
4 files changed
+10
-10
No files matched your search
@@ -15,9 +15,9 @@ const connect = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
const checkAdmin = async (req, res) => {
|
||||
const checkSuperadmin = async (req, res) => {
|
||||
try {
|
||||
const admin = await UserModel.findOne({ role: "admin" });
|
||||
const admin = await UserModel.findOne({ role: "superadmin" });
|
||||
if (admin !== null) {
|
||||
return true;
|
||||
}
|
||||
@@ -141,7 +141,7 @@ module.exports = {
|
||||
requestRecoveryToken,
|
||||
validateRecoveryToken,
|
||||
resetPassword,
|
||||
checkAdmin,
|
||||
checkSuperadmin,
|
||||
getAllMonitors,
|
||||
getMonitorStatsById,
|
||||
getMonitorById,
|
||||
|
||||
Reference in new issue
Block a user