权限表如图:
此主题相关图片如下:1.jpg

我现在建了3个内部函数
①shouquan
Dim dt As DataTable = DataTables("授权")
Dim dr As DataRow
dr = dt.Find("导航分组 = '" & args(0) & "' And 功能模块 = '" & args(1) & "' And 流程 = '" & args(2) & "'")
If dr.IsNull("用户") = False Then
Dim nms() As String = dr("用户").Split(",")
For Each nm As String In nms
If nm = _UserGroup Then '如果授权用户包括登录用户所属的分组或其用户名
Return True '返回True
End If
Next
End If
Return False
②shouquan导航分组
Dim dt As DataTable = DataTables("授权")
Dim drs As List(of DataRow)
drs = dt.Select("导航分组 = '" & args(0) & "'")
For Each mr As DataRow In drs
If mr.IsNull("用户") = False Then
Dim nms() As String = mr("用户").Split(",")
For Each nm As String In nms
If nm = _UserGroup Then '如果授权用户包括登录用户所属的分组或其用户名
Return True '返回True
End If
Next
End If
Next
Return False
③shouquan功能模块
Dim dt As DataTable = DataTables("授权")
Dim drs As List(of DataRow)
drs = dt.Select("功能模块 = '" & args(0) & "'")
For Each mr As DataRow In drs
If mr.IsNull("用户") = False Then
Dim nms() As String = mr("用户").Split(",")
For Each nm As String In nms
If nm = _UserGroup Then '如果授权用户包括登录用户所属的分组或其用户名
Return True '返回True
End If
Next
End If
Next
Return False
shouquan是为了判断 3列的权限
shouquan导航分组 是为了判断是否有【导航分组】权限 不需要再判断后面2列
shouquan功能模块 类似
请问这样是否合理??