owl-cli 6.100.0 → 6.102.0
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.
|
@@ -679,18 +679,17 @@ function getListPermissionFilter(tableId, roleId,orgId,userId, permissions){
|
|
|
679
679
|
return null;
|
|
680
680
|
}
|
|
681
681
|
|
|
682
|
+
$.log("getListPermissionFilter tableId="+tableId+",roleId="+roleId+",orgId="+orgId+",userId="+userId+", permissions="+JSON.stringify(permissions));
|
|
682
683
|
//获得有权限的对象的filter
|
|
683
684
|
var tp = expandTablePermission(permissions);
|
|
684
685
|
|
|
685
686
|
|
|
686
687
|
//如果有listAll
|
|
687
688
|
|
|
688
|
-
if(tp.same_org.listall==='allowed' || tp.sub_org.listall==='allowed') {
|
|
689
|
+
if(tp.same_org.listall==='allowed' || tp.sub_org.listall==='allowed' || roleId=='0' || userId=='0') {
|
|
689
690
|
//只能读取本组织的数据
|
|
690
|
-
var objFilters = getObjectPermissionFilter(tableId, roleId,orgId,userId, permissions);
|
|
691
|
-
var orgFilter =
|
|
692
|
-
"term": {"_orgId.keyword": orgId}
|
|
693
|
-
};
|
|
691
|
+
// var objFilters = getObjectPermissionFilter(tableId, roleId,orgId,userId, permissions);
|
|
692
|
+
var orgFilter = null;
|
|
694
693
|
if(tp.sub_org.listall==='allowed'){
|
|
695
694
|
if(orgId!='0'){
|
|
696
695
|
orgFilter = {
|
|
@@ -701,33 +700,40 @@ function getListPermissionFilter(tableId, roleId,orgId,userId, permissions){
|
|
|
701
700
|
orgFilter = { "match_all": {}};
|
|
702
701
|
}
|
|
703
702
|
}
|
|
704
|
-
if(tp.same_org.listall
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
703
|
+
else if(tp.same_org.listall==='allowed'){
|
|
704
|
+
if(orgId!='0'){
|
|
705
|
+
orgFilter = {
|
|
706
|
+
"term": {"_orgId.keyword": orgId}
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
else{
|
|
710
|
+
orgFilter = { "match_all": {}};
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
}
|
|
714
|
+
else {
|
|
715
|
+
if(orgId!='0'){
|
|
716
|
+
orgFilter = {
|
|
717
|
+
"term": {"_orgIds.keyword": orgId}
|
|
713
718
|
}
|
|
714
719
|
}
|
|
720
|
+
else{
|
|
721
|
+
orgFilter = { "match_all": {}};
|
|
722
|
+
}
|
|
715
723
|
}
|
|
716
|
-
var shouldFilters =
|
|
724
|
+
var shouldFilters = [];
|
|
717
725
|
if(orgFilter){
|
|
718
726
|
shouldFilters.push(orgFilter);
|
|
719
727
|
}
|
|
720
728
|
//组合对象允许的
|
|
721
729
|
return {
|
|
722
730
|
bool:{
|
|
723
|
-
should:shouldFilters
|
|
724
|
-
must_not:objFilters[1]
|
|
731
|
+
should:shouldFilters
|
|
725
732
|
}
|
|
726
733
|
}
|
|
727
734
|
}
|
|
728
735
|
else {
|
|
729
736
|
var objFilters = getObjectPermissionFilter(tableId, roleId,orgId,userId, permissions);
|
|
730
|
-
|
|
731
737
|
return {
|
|
732
738
|
bool:{
|
|
733
739
|
should:objFilters[0],
|