lista ordini aggiornata
This commit is contained in:
@@ -625,6 +625,16 @@ UserSchema.statics.isManager = function (perm) {
|
||||
}
|
||||
};
|
||||
|
||||
UserSchema.statics.isManagerById = async function (id) {
|
||||
try {
|
||||
const ris = await User.findOne({ _id: id }, { perm: 1 }).lean();
|
||||
return ((ris.perm & shared_consts.Permissions.Manager) ===
|
||||
shared_consts.Permissions.Manager);
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
UserSchema.statics.isEditor = function (perm) {
|
||||
try {
|
||||
return ((perm & shared_consts.Permissions.Editor) ===
|
||||
|
||||
Reference in New Issue
Block a user