mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-21 01:46:28 +08:00
core: bug fix
This commit is contained in:
1 parent
9a6d737a4b
commit
62246b096a
2 files changed
+3
-1
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "3.2.18",
|
"version": "3.2.19",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
@@ -125,6 +125,7 @@ class RecordDetailHandler extends Handler {
|
|||||||
|
|
||||||
let canViewCode = rdoc.uid === this.user._id;
|
let canViewCode = rdoc.uid === this.user._id;
|
||||||
canViewCode ||= this.user.hasPriv(PRIV.PRIV_READ_RECORD_CODE);
|
canViewCode ||= this.user.hasPriv(PRIV.PRIV_READ_RECORD_CODE);
|
||||||
|
canViewCode ||= this.user.hasPerm(PERM.PERM_READ_RECORD_CODE);
|
||||||
canViewCode ||= this.user.hasPerm(PERM.PERM_READ_RECORD_CODE_ACCEPT) && self?.status === STATUS.STATUS_ACCEPTED;
|
canViewCode ||= this.user.hasPerm(PERM.PERM_READ_RECORD_CODE_ACCEPT) && self?.status === STATUS.STATUS_ACCEPTED;
|
||||||
if (!canViewCode) {
|
if (!canViewCode) {
|
||||||
rdoc.code = '';
|
rdoc.code = '';
|
||||||
@@ -285,6 +286,7 @@ class RecordDetailConnectionHandler extends ConnectionHandler {
|
|||||||
|
|
||||||
let canViewCode = rdoc.uid === this.user._id;
|
let canViewCode = rdoc.uid === this.user._id;
|
||||||
canViewCode ||= this.user.hasPriv(PRIV.PRIV_READ_RECORD_CODE);
|
canViewCode ||= this.user.hasPriv(PRIV.PRIV_READ_RECORD_CODE);
|
||||||
|
canViewCode ||= this.user.hasPerm(PERM.PERM_READ_RECORD_CODE);
|
||||||
canViewCode ||= this.user.hasPerm(PERM.PERM_READ_RECORD_CODE_ACCEPT) && self?.status === STATUS.STATUS_ACCEPTED;
|
canViewCode ||= this.user.hasPerm(PERM.PERM_READ_RECORD_CODE_ACCEPT) && self?.status === STATUS.STATUS_ACCEPTED;
|
||||||
if (!canViewCode) {
|
if (!canViewCode) {
|
||||||
rdoc.code = '';
|
rdoc.code = '';
|
||||||
|
|||||||
Reference in new issue
Block a user