feat: 优化判断路径,检查并添加部分忽略注释
This commit is contained in:
parent
09b1207af3
commit
86b9f217af
File diff suppressed because it is too large
Load Diff
|
|
@ -31,6 +31,7 @@ class RelationAuth {
|
||||||
if (context.isRoot()) {
|
if (context.isRoot()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// @oak-ignore 这里只有纯前台会跑到,一定是同步的
|
||||||
this.checkActions2(entity, operation, context);
|
this.checkActions2(entity, operation, context);
|
||||||
}
|
}
|
||||||
// 后台检查filter是否满足relation约束
|
// 后台检查filter是否满足relation约束
|
||||||
|
|
|
||||||
|
|
@ -1566,6 +1566,7 @@ function checkDeduceFilters(dfc, context) {
|
||||||
const andResult = $and.map((ele) => {
|
const andResult = $and.map((ele) => {
|
||||||
if (ele.hasOwnProperty('entity')) {
|
if (ele.hasOwnProperty('entity')) {
|
||||||
const ele2 = ele;
|
const ele2 = ele;
|
||||||
|
// @oak-ignore
|
||||||
return context.count(ele2.entity, {
|
return context.count(ele2.entity, {
|
||||||
filter: ele2.filter
|
filter: ele2.filter
|
||||||
}, { ignoreAttrMiss: true });
|
}, { ignoreAttrMiss: true });
|
||||||
|
|
@ -1595,6 +1596,7 @@ function checkDeduceFilters(dfc, context) {
|
||||||
const orResult = $or.map((ele) => {
|
const orResult = $or.map((ele) => {
|
||||||
if (ele.hasOwnProperty('entity')) {
|
if (ele.hasOwnProperty('entity')) {
|
||||||
const ele2 = ele;
|
const ele2 = ele;
|
||||||
|
// @oak-ignore
|
||||||
return context.count(ele2.entity, {
|
return context.count(ele2.entity, {
|
||||||
filter: ele2.filter
|
filter: ele2.filter
|
||||||
}, { ignoreAttrMiss: true });
|
}, { ignoreAttrMiss: true });
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -69,6 +69,7 @@ export class RelationAuth<ED extends EntityDict & BaseEntityDict> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @oak-ignore 这里只有纯前台会跑到,一定是同步的
|
||||||
this.checkActions2(entity, operation, context);
|
this.checkActions2(entity, operation, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1783,6 +1783,7 @@ function checkDeduceFilters<ED extends EntityDict & BaseEntityDict, Cxt extends
|
||||||
(ele) => {
|
(ele) => {
|
||||||
if (ele.hasOwnProperty('entity')) {
|
if (ele.hasOwnProperty('entity')) {
|
||||||
const ele2 = ele as DeducedFilter<ED, keyof ED>;
|
const ele2 = ele as DeducedFilter<ED, keyof ED>;
|
||||||
|
// @oak-ignore
|
||||||
return context.count(ele2.entity, {
|
return context.count(ele2.entity, {
|
||||||
filter: ele2.filter
|
filter: ele2.filter
|
||||||
}, { ignoreAttrMiss: true });
|
}, { ignoreAttrMiss: true });
|
||||||
|
|
@ -1818,6 +1819,7 @@ function checkDeduceFilters<ED extends EntityDict & BaseEntityDict, Cxt extends
|
||||||
(ele) => {
|
(ele) => {
|
||||||
if (ele.hasOwnProperty('entity')) {
|
if (ele.hasOwnProperty('entity')) {
|
||||||
const ele2 = ele as DeducedFilter<ED, keyof ED>;
|
const ele2 = ele as DeducedFilter<ED, keyof ED>;
|
||||||
|
// @oak-ignore
|
||||||
return context.count(ele2.entity, {
|
return context.count(ele2.entity, {
|
||||||
filter: ele2.filter
|
filter: ele2.filter
|
||||||
}, { ignoreAttrMiss: true });
|
}, { ignoreAttrMiss: true });
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue