mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: add maintainer field for doc (#101)
This commit is contained in:
1 parent
7bde6a922c
commit
da32c79f21
24 files changed
+85
-74
No files matched your search
@@ -161,7 +161,7 @@ class TrainingDetailHandler extends Handler {
|
||||
@param('tid', Types.ObjectID)
|
||||
async postDelete(domainId: string, tid: ObjectID) {
|
||||
const tdoc = await training.get(domainId, tid);
|
||||
if (tdoc.owner !== this.user._id) this.checkPerm(PERM.PERM_EDIT_TRAINING);
|
||||
if (!this.user.own(tdoc)) this.checkPerm(PERM.PERM_EDIT_TRAINING);
|
||||
await training.del(domainId, tid);
|
||||
this.response.redirect = this.url('training_main');
|
||||
}
|
||||
@@ -205,7 +205,7 @@ class TrainingEditHandler extends Handler {
|
||||
@param('tid', Types.ObjectID)
|
||||
async prepare(domainId: string, tid: ObjectID) {
|
||||
this.tdoc = await training.get(domainId, tid);
|
||||
if (this.tdoc.owner !== this.user._id) this.checkPerm(PERM.PERM_EDIT_TRAINING);
|
||||
if (!this.user.own(this.tdoc)) this.checkPerm(PERM.PERM_EDIT_TRAINING);
|
||||
else this.checkPerm(PERM.PERM_EDIT_TRAINING_SELF);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user