修改了operation的权限判断

This commit is contained in:
Xu Chang 2022-12-14 18:04:06 +08:00
parent f2519da40d
commit da983ba2bd
2 changed files with 7 additions and 0 deletions

View File

@ -9,6 +9,9 @@ async function operate(params, context) {
// operate默认必须用户登录
throw new types_1.OakUnloggedInException();
}
if (!context.allowUserUpdate()) {
throw new types_1.OakUserUnpermittedException('您被禁更新');
}
if (operation instanceof Array) {
const result = [];
for (const oper of operation) {

View File

@ -3,6 +3,7 @@ import {
EntityDict,
SelectOption,
OakUnloggedInException,
OakUserUnpermittedException,
} from 'oak-domain/lib/types';
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
import { AsyncContext } from 'oak-domain/lib/store/AsyncRowStore';
@ -26,6 +27,9 @@ export async function operate<
// operate默认必须用户登录
throw new OakUnloggedInException();
}
if (!context.allowUserUpdate()) {
throw new OakUserUnpermittedException('您被禁更新');
}
if (operation instanceof Array) {
const result = [];