core: allow manually disable training enrolled users

This commit is contained in:
undefined committed 2024-08-08 21:01:56 +08:00
1 parent 108661fe4e
commit 9a5ae6404e
1 file changed
+1 -1
+1 -1
View File
@@ -104,7 +104,7 @@ class TrainingDetailHandler extends Handler {
let enrollUsers: number[] = [];
let shouldCompare = false;
const pids = training.getPids(tdoc.dag);
if (this.user.hasPriv(PRIV.PRIV_USER_PROFILE)) {
if (this.user.hasPriv(PRIV.PRIV_USER_PROFILE) && this.ctx.setting.get('training.enrolled-list')) {
enrollUsers = (await training.getMultiStatus(domainId, { docId: tid, uid: { $gt: 1 }, enroll: 1 })
.project({ uid: 1 }).limit(500).toArray()).map((x) => +x.uid);
shouldCompare = uid !== this.user._id;