owl-cli 6.101.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.
|
@@ -675,17 +675,18 @@ function getObjectPermissionFilter(tableId, roleId,orgId,userId){
|
|
|
675
675
|
return [filters,excludeFilters]
|
|
676
676
|
}
|
|
677
677
|
function getListPermissionFilter(tableId, roleId,orgId,userId, permissions){
|
|
678
|
-
if(userId==='0' && orgId==='0'){
|
|
678
|
+
if(userId==='0' && orgId==='0' && roleId==='0'){
|
|
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
691
|
// var objFilters = getObjectPermissionFilter(tableId, roleId,orgId,userId, permissions);
|
|
691
692
|
var orgFilter = null;
|
|
@@ -710,6 +711,16 @@ function getListPermissionFilter(tableId, roleId,orgId,userId, permissions){
|
|
|
710
711
|
}
|
|
711
712
|
|
|
712
713
|
}
|
|
714
|
+
else {
|
|
715
|
+
if(orgId!='0'){
|
|
716
|
+
orgFilter = {
|
|
717
|
+
"term": {"_orgIds.keyword": orgId}
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
else{
|
|
721
|
+
orgFilter = { "match_all": {}};
|
|
722
|
+
}
|
|
723
|
+
}
|
|
713
724
|
var shouldFilters = [];
|
|
714
725
|
if(orgFilter){
|
|
715
726
|
shouldFilters.push(orgFilter);
|