ui: fix assign text & core: allow owner get homework detail (#345)

This commit is contained in:
panda authored and GitHub committed 2022-04-25 17:17:04 +08:00
1 parent de9426a7fc
commit 59f1b4e429
7 files changed
+8 -4

No files matched your search

+1 -1
View File
@@ -61,7 +61,7 @@ class DiscussionHandler extends Handler {
// TODO(twd2): exclude problem/contest discussions?
// TODO(iceboy): continuation based pagination.
this.vnode = await discussion.getVnode(domainId, typeMapper[type], name, this.user._id);
if (this.vnode.assign?.length) {
if (this.vnode.assign?.length && !this.user.own(this.vnode)) {
if (!Set.intersection(this.vnode.assign, this.user.group).size) {
throw new PermissionError(PERM.PERM_VIEW_PROBLEM_HIDDEN);
}