去掉了一个多余的assert

This commit is contained in:
Xu Chang 2023-07-18 11:37:48 +08:00
parent 700545aa01
commit 846626d9dc
2 changed files with 2 additions and 2 deletions

View File

@ -1058,7 +1058,7 @@ var RelationAuth = /** @class */ (function () {
var e_4 = root.entity, d = root.data, f = root.filter, a = root.action; var e_4 = root.entity, d = root.data, f = root.filter, a = root.action;
if (userRelations.length > 0) { if (userRelations.length > 0) {
(0, assert_1.default)(e_4 !== 'user'); (0, assert_1.default)(e_4 !== 'user');
(0, assert_1.default)(a === 'create' && !(d instanceof Array)); (0, assert_1.default)(!(d instanceof Array));
var createIds_1 = userRelations.map(function (ele) { return ele.relationId; }); var createIds_1 = userRelations.map(function (ele) { return ele.relationId; });
// 这里处理的是创建对象时顺带创建相关权限要检查该权限是不是有create动作授权 // 这里处理的是创建对象时顺带创建相关权限要检查该权限是不是有create动作授权
var aas = context.select('actionAuth', { var aas = context.select('actionAuth', {

View File

@ -1245,7 +1245,7 @@ export class RelationAuth<ED extends EntityDict & BaseEntityDict>{
const { entity: e, data: d, filter: f, action: a } = root; const { entity: e, data: d, filter: f, action: a } = root;
if (userRelations.length > 0) { if (userRelations.length > 0) {
assert(e !== 'user'); assert(e !== 'user');
assert(a === 'create' && !(d instanceof Array)); assert(!(d instanceof Array));
const createIds = userRelations.map(ele => ele.relationId!); const createIds = userRelations.map(ele => ele.relationId!);
// 这里处理的是创建对象时顺带创建相关权限要检查该权限是不是有create动作授权 // 这里处理的是创建对象时顺带创建相关权限要检查该权限是不是有create动作授权
const aas = context.select('actionAuth', { const aas = context.select('actionAuth', {