在checkAction前,cloneDeep此operation,以避免不必要的混乱

This commit is contained in:
Xu Chang 2023-07-25 19:08:05 +08:00
parent a4ebb81c40
commit 8f49fa0ca1
2 changed files with 5 additions and 5 deletions

View File

@ -1522,7 +1522,7 @@ var RelationAuth = /** @class */ (function () {
}); });
} }
}; };
destructInner(entity, selection); destructInner(entity, (0, lodash_1.cloneDeep)(selection));
return leafSelections; return leafSelections;
}; };
/** /**
@ -1647,7 +1647,7 @@ var RelationAuth = /** @class */ (function () {
} }
return root; return root;
}; };
return destructInner(entity2, operation2); return destructInner(entity2, (0, lodash_1.cloneDeep)(operation2));
}; };
/** /**
* 定位到了当前用户所有可能的actionAuth再用以判定对应的entity是不是满足当前的查询约束 * 定位到了当前用户所有可能的actionAuth再用以判定对应的entity是不是满足当前的查询约束

View File

@ -7,7 +7,7 @@ import { addFilterSegment, checkFilterContains, combineFilters } from "./filter"
import { judgeRelation } from "./relation"; import { judgeRelation } from "./relation";
import { SyncContext } from "./SyncRowStore"; import { SyncContext } from "./SyncRowStore";
import { readOnlyActions } from '../actions/action'; import { readOnlyActions } from '../actions/action';
import { difference, intersection, set, uniq, groupBy } from '../utils/lodash'; import { difference, intersection, set, uniq, cloneDeep } from '../utils/lodash';
import { SYSTEM_RESERVE_ENTITIES } from "../compiler/env"; import { SYSTEM_RESERVE_ENTITIES } from "../compiler/env";
@ -1785,7 +1785,7 @@ export class RelationAuth<ED extends EntityDict & BaseEntityDict>{
} }
}; };
destructInner(entity, selection); destructInner(entity, cloneDeep(selection));
return leafSelections; return leafSelections;
} }
@ -1917,7 +1917,7 @@ export class RelationAuth<ED extends EntityDict & BaseEntityDict>{
return root; return root;
}; };
return destructInner(entity2, operation2); return destructInner(entity2, cloneDeep(operation2));
} }
/** /**