我在设计窗口表和表的编辑功能权限时,代码如下:
If User.Type = UserTypeEnum.User Then
For Each t As Table In Tables
t.AllowEdit=False
If t.Name.Contains("_") Then
t.AllowEdit=False
Dim ary() As String = t.Name.Split("_")
Dim fdr As DataRow = DataTables("权限管理").Find("用户名 = '" & UserName & "' and 窗口 = '" & ary(0) & "' and 表名 = '" & ary(1) & "'")
If fdr IsNot Nothing Then
t.AllowEdit = fdr("可编辑")
Else
t.AllowEdit = False
End If
Else
Dim fdr As DataRow = DataTables("权限管理").Find("用户名 = '" & UserName & "' and 表名 = '" & t.Name & "'")
If fdr IsNot Nothing Then
t.AllowEdit = fdr("可编辑")
End If
End If
Next
End If
加上上面红字,全部表不能编辑,去掉红字,全部表都能编辑,请教大师指点如何实现用户对不同表和窗口表的编辑权限设置。