mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: session sudo mode
This commit is contained in:
1 parent
52933de354
commit
f075301286
11 files changed
+125
-24
No files matched your search
@@ -14,8 +14,7 @@ import * as system from '../model/system';
|
||||
import user from '../model/user';
|
||||
import * as bus from '../service/bus';
|
||||
import {
|
||||
ConnectionHandler, Handler,
|
||||
param, Types,
|
||||
ConnectionHandler, Handler, param, requireSudo, Types,
|
||||
} from '../service/server';
|
||||
import { configSource, saveConfig, SystemSettings } from '../settings';
|
||||
import * as judge from './judge';
|
||||
@@ -142,6 +141,7 @@ class SystemScriptHandler extends SystemHandler {
|
||||
}
|
||||
|
||||
class SystemSettingHandler extends SystemHandler {
|
||||
@requireSudo
|
||||
async get() {
|
||||
this.response.template = 'manage_setting.html';
|
||||
this.response.body.current = {};
|
||||
@@ -151,6 +151,7 @@ class SystemSettingHandler extends SystemHandler {
|
||||
}
|
||||
}
|
||||
|
||||
@requireSudo
|
||||
async post(args: any) {
|
||||
const tasks = [];
|
||||
const booleanKeys = args.booleanKeys || {};
|
||||
@@ -179,6 +180,7 @@ class SystemSettingHandler extends SystemHandler {
|
||||
}
|
||||
|
||||
class SystemConfigHandler extends SystemHandler {
|
||||
@requireSudo
|
||||
async get() {
|
||||
this.response.template = 'manage_config.html';
|
||||
let value = configSource;
|
||||
@@ -191,6 +193,7 @@ class SystemConfigHandler extends SystemHandler {
|
||||
};
|
||||
}
|
||||
|
||||
@requireSudo
|
||||
@param('value', Types.String)
|
||||
async post(domainId: string, value: string) {
|
||||
let config;
|
||||
|
||||
Reference in new issue
Block a user