oak-domain 4.2.0 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/store/RelationAuth.js +5 -35
- package/package.json +1 -1
|
@@ -668,14 +668,11 @@ class RelationAuth {
|
|
|
668
668
|
const filters = actionAuths.filter(ele => ele.path.destEntity === entity).map((ele) => {
|
|
669
669
|
const { path, relation, relationId } = ele;
|
|
670
670
|
if (relationId) {
|
|
671
|
-
(0, assert_1.default)(relation);
|
|
672
|
-
const { userRelation$relation: userRelations } = relation;
|
|
673
|
-
(0, assert_1.default)(userRelations.length > 0);
|
|
674
|
-
const entityIds = (0, lodash_1.uniq)(userRelations.map(ele => ele.entityId));
|
|
675
671
|
const pathFilter = this.makePathFilter(entity, path, this.schema, {
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
672
|
+
userRelation$entity: {
|
|
673
|
+
userId: context.getCurrentUserId(),
|
|
674
|
+
relationId,
|
|
675
|
+
}
|
|
679
676
|
});
|
|
680
677
|
return pathFilter;
|
|
681
678
|
}
|
|
@@ -727,20 +724,7 @@ class RelationAuth {
|
|
|
727
724
|
recursive: 1,
|
|
728
725
|
},
|
|
729
726
|
deActions: 1,
|
|
730
|
-
|
|
731
|
-
id: 1,
|
|
732
|
-
userRelation$relation: {
|
|
733
|
-
$entity: 'userRelation',
|
|
734
|
-
data: {
|
|
735
|
-
id: 1,
|
|
736
|
-
entity: 1,
|
|
737
|
-
entityId: 1,
|
|
738
|
-
},
|
|
739
|
-
filter: {
|
|
740
|
-
userId: context.getCurrentUserId(),
|
|
741
|
-
},
|
|
742
|
-
},
|
|
743
|
-
},
|
|
727
|
+
relationId: 1,
|
|
744
728
|
},
|
|
745
729
|
filter: {
|
|
746
730
|
deActions: {
|
|
@@ -751,20 +735,6 @@ class RelationAuth {
|
|
|
751
735
|
$in: allEntities,
|
|
752
736
|
},
|
|
753
737
|
},
|
|
754
|
-
$or: [
|
|
755
|
-
{
|
|
756
|
-
relation: {
|
|
757
|
-
userRelation$relation: {
|
|
758
|
-
userId: context.getCurrentUserId(),
|
|
759
|
-
},
|
|
760
|
-
}
|
|
761
|
-
},
|
|
762
|
-
{
|
|
763
|
-
relationId: {
|
|
764
|
-
$exists: false,
|
|
765
|
-
},
|
|
766
|
-
}
|
|
767
|
-
]
|
|
768
738
|
}
|
|
769
739
|
}, { dontCollect: true, ignoreAttrMiss: true });
|
|
770
740
|
/**
|