For Each t As Table In Tables
t.Visible = True
t.AllowEdit = True
For Each c As Col In t.Cols
c.Visible = True
c.AllowEdit = True
Next
Next
If User.Group <> "厂办" Then
Tables("表权限").Visible = False
Else
Tables("表权限").Visible = True
End If
quanx = "'" & quanx.Replace(",", "','") & "'"
For Each dr As DataRow In DataTables("表权限").Select("权限 in (" & quanx & ")" )
If dr.IsNull("列名") Then
Tables(dr("表名")).Visible = Not dr("不可见")
Tables(dr("表名")).AllowEdit = Not dr("不可编辑")
Else
Dim nms() As String = dr("列名").Split(",")
For Each nm As String In nms
Tables(dr("表名")).Cols(nm).Visible = Not dr("不可见")
Tables(dr("表名")).Cols(nm).AllowEdit = Not dr("不可编辑")
Next
End If
Next
如果是一个用户(如张2)有多个角色那么以上涂色的代码得到的“限制权限”的并集,即用户的权限小了。了,如何得到的是“限制权限”的交集,使用户的权限范围应该是变大。请教高手如何实现。