mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
ui: checkPriv for setTheme
This commit is contained in:
1 parent
35632cc1aa
commit
c2d5696919
2 files changed
+3
-2
No files matched your search
@@ -6,7 +6,7 @@ import { join } from 'path';
|
||||
import { ObjectID } from 'mongodb';
|
||||
import * as bus from 'hydrooj/src/service/bus';
|
||||
import { Route, Handler } from 'hydrooj/src/service/server';
|
||||
import { PERM } from 'hydrooj/src/model/builtin';
|
||||
import { PERM, PRIV } from 'hydrooj/src/model/builtin';
|
||||
import markdown from './backendlib/markdown';
|
||||
|
||||
const {
|
||||
@@ -88,6 +88,7 @@ class SetThemeHandler extends Handler {
|
||||
noCheckPermView = true;
|
||||
|
||||
async get({ theme }) {
|
||||
this.checkPriv(PRIV.PRIV_USER_PROFILE);
|
||||
await user.setById(this.user._id, { theme });
|
||||
this.back();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/ui-default",
|
||||
"version": "4.34.11",
|
||||
"version": "4.34.12",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "hydro.js",
|
||||
|
||||
Reference in new issue
Block a user