Foxtable(狐表)用户栏目专家坐堂 → 关于可视化授权的问题


  共有9533人关注过本帖平板打印复制链接

主题:关于可视化授权的问题

帅哥哟,离线,有人找我吗?
ljz
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:273 积分:3400 威望:0 精华:0 注册:2012/4/20 16:43:00
关于可视化授权的问题  发帖心情 Post By:2012/10/26 15:28:00 [只看该作者]

 

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)有多个角色那么以上涂色的代码得到的“限制权限”的并集,即用户的权限小了。了,如何得到的是“限制权限”的交集,使用户的权限范围应该是变大。请教高手如何实现。

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:目录树与可视授权.table


 回到顶部