- nella lista circuiti ora si vedono tutti gli annunci del circuito stesso

This commit is contained in:
Surya Paolo
2025-01-15 15:39:53 +01:00
parent 5ba86e3641
commit 332b8992a9
4 changed files with 25 additions and 6 deletions

View File

@@ -279,7 +279,7 @@ CircuitSchema.statics.isCircuitAdmin = async function (idrec, username) {
const mycirc = await Circuit.findOne({ _id: idrec }).lean();
if (mycirc) {
return mycirc.admins.some(admin => admin.username === username);
return mycirc.admins.some(admin => (admin.username === username) || (admin.username === shared_consts.USER_ADMIN_CIRCUITS));
}
return false;
@@ -1003,7 +1003,9 @@ CircuitSchema.statics.getListAdminsByCircuitPath = async function (idapp, circui
{ deleted: { $exists: true, $eq: false } }],
}, { admins: 1 }).lean();
return arr && arr.admins ? arr.admins : [];
let myarr = arr && arr.admins ? arr.admins : [];
return [...myarr, shared_consts.USER_ADMIN_CIRCUITS]
};
@@ -1206,7 +1208,7 @@ CircuitSchema.statics.isAdminCircuit = async function (idapp, circuitname, usern
if (arr) {
for (const admin of arr.admins) {
if (admin.username === username)
if ((admin.username === username) || (shared_consts.USER_ADMIN_CIRCUITS === username))
return true;
}
}

View File

@@ -1926,6 +1926,8 @@ UserSchema.statics.getUserProfileByUsername = async function (
'profile.friends': 1,
email: 1,
date_reg: 1,
perm: 1,
'useraport.perm': 1,
'useraport.username': 1,
'useraport.profile.img': 1,
};
@@ -1974,6 +1976,7 @@ UserSchema.statics.getUserProfileByUsername = async function (
'profile.friends': 1,
email: 1,
date_reg: 1,
'useraport.perm': 1,
'useraport.username': 1,
'useraport.profile.img': 1,
};
@@ -2025,8 +2028,10 @@ UserSchema.statics.getUserProfileByUsername = async function (
'comune': 1,
email: 1,
date_reg: 1,
'useraport.perm': 1,
'useraport.username': 1,
'useraport.profile.img': 1,
perm: 1,
};
}
@@ -3451,6 +3456,7 @@ function getWhatToShow(idapp, username) {
'profile.handshake': 1,
'profile.note': 1,
'profile.da_contattare': 1,
perm: 1,
};
}
@@ -3482,6 +3488,7 @@ function getWhatToShow_Unknown(idapp, username) {
'profile.bookmark': 1,
'profile.attend': 1,
'profile.seen': 1,
perm: 1,
}
}
@@ -3516,6 +3523,7 @@ UserSchema.statics.getWhatToShow_IfFriends = async function (idapp, username) {
'profile.bookmark': 1,
'profile.attend': 1,
'profile.seen': 1,
perm: 1,
};
};
@@ -5366,6 +5374,7 @@ UserSchema.statics.getQueryReceiveRISUsers = function (idapp, hours) {
'profile.handshake': 1,
'profile.note': 1,
'profile.da_contattare': 1,
perm: 1,
},
},
];