If User.Type = UserTypeEnum.User Then
For Each dr1 As DataRow In DataTables("授权表三").DataRows
Dim nms() As String
Dim nms1() As String
If dr1.Isnull("受限角色")=False Then
nms = dr1("受限角色").Split(",")
Else
Continue For
End If
If dr1.Isnull("非受限角色")=False Then
nms1 = dr1("非受限角色").Split(",")
Else
Continue For
End If
For Each nm As String In nms
For Each nm1 As String In nms1
If dr1("用户名列")=True Then
If dr1.Isnull("非受限角色")=False And User.IsRole(nm1) Then
DataTables(dr1("表名")).LoadFilter = ""
ElseIf dr1.Isnull("受限角色")=False And dr1.Isnull("列内容")=False And User.IsRole(nm) Then
DataTables(dr1("表名")).LoadFilter = "" & dr1("列名") & " In ( '" & dr1("列内容").replace(",","','") & "')"
Else
DataTables(dr1("表名")).LoadFilter = "" & dr1("列名") & " = '" & User.Name & "'"
End If
End If
If dr1("用户名列")=False Then
If dr1.Isnull("非受限角色")=False And User.IsRole(nm1) Then
DataTables(dr1("表名")).LoadFilter = ""
ElseIf dr1.Isnull("受限角色")=False And dr1.Isnull("列内容")=False And User.IsRole(nm) Then
DataTables(dr1("表名")).LoadFilter = "" & dr1("列名") & " In ( '" & dr1("列内容").replace(",","','") & "')"
End If
End If
Next
Next
Next
End If
此主题相关图片如下:微信图片_20210804184831.png
当符合标颜色的条件时,还是会加载全部的数据,条件没起作用