core: add PERM_PIN_TRAINING

This commit is contained in:
undefined committed 2021-07-03 00:11:41 +08:00
1 parent eb62a40b01
commit 745141741b
3 files changed
+3 -2

No files matched your search

+1 -1
View File
@@ -237,7 +237,7 @@ class TrainingEditHandler extends Handler {
title: string, content: string,
_dag: string, pin = false, description: string,
) {
if (this.tdoc.pin !== pin) this.checkPerm(PERM.PERM_PIN_TRAINING);
if ((!!this.tdoc.pin) !== pin) this.checkPerm(PERM.PERM_PIN_TRAINING);
const dag = await _parseDagJson(domainId, _dag);
const pids = training.getPids(dag);
assert(pids.length, new ValidationError('dag'));