core&ui: contest: add print (#1036)

Co-authored-by: panda <panda_dtdyy@outlook.com>
This commit is contained in:
undefinedandpanda authored and GitHub committed 2025-08-17 05:02:45 +01:00
1 parent 1c7b2275ff
commit 720eb6b7e0
13 files changed
+419 -6

No files matched your search

+3 -1
View File
@@ -162,7 +162,9 @@ export class User {
serialize(h) {
if (!this._isPrivate) {
const fields = ['_id', 'uname', 'mail', 'perm', 'role', 'priv', 'regat', 'loginat', 'tfa', 'authn'];
if (h?.user?.hasPerm(PERM.PERM_VIEW_DISPLAYNAME)) fields.push('displayName');
if (h?.user?.hasPerm(PERM.PERM_VIEW_DISPLAYNAME)) {
fields.push('displayName', 'school', 'studentId');
}
return pick(this, fields);
}
return JSON.stringify(this, serializer(true, h));