以文本方式查看主题 - Foxtable(狐表) (http://www.foxtable.com/bbs/index.asp) -- 专家坐堂 (http://www.foxtable.com/bbs/list.asp?boardid=2) ---- 加了授权的代码,还是能看到内容 (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=122715) |
-- 作者:DLW77 -- 发布时间:2018/7/31 20:03:00 -- 加了授权的代码,还是能看到内容 我在AfterOpenProject中加了这个代码,列名不可见部分还是显示出来。整个表不可见的,就没显示出来,但是列名不可见的,就不行。 此主题相关图片如下:{84jairwu6vl_gk_p~n.png Tables("授权表").Visible = (User.Type <> UserTypeEnum.User ) If User.Type = UserTypeEnum.User Then For Each dr As DataRow In DataTables("授权表").Select("用户名 = \'" & User.Group & "\'" ) If dr.IsNull("列名") Then Tables(dr("表名")).Visible = Not dr("不可见") Tables(dr("表名")).AllowEdit = Not dr("不可编辑") Else Tables(dr("表名")).Cols(dr("列名")).Visible = Not dr("不可见") Tables(dr("表名")).Cols(dr("列名")).AllowEdit = Not dr("不可编辑") End If Next End If
|
-- 作者:有点蓝 -- 发布时间:2018/7/31 20:38:00 -- http://www.foxtable.com/webhelp/scr/1600.htm 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 Tables("授权表").Visible = (User.Type <> UserTypeEnum.User ) If User.Type = UserTypeEnum.User Then For Each dr As DataRow In DataTables("授权表").Select("用户名 = \'" & User.Name & "\'" ) If dr.IsNull("列名") Then Tables(dr("表名")).Visible = Not dr("不可见") Tables(dr("表名")).AllowEdit = Not dr("不可编辑") Else Tables(dr("表名")).Cols(dr("列名")).Visible = Not dr("不可见") Tables(dr("表名")).Cols(dr("列名")).AllowEdit = Not dr("不可编辑") End If Next End If |
-- 作者:DLW77 -- 发布时间:2018/8/1 8:46:00 -- 以角色控制权限,怎么写? 老师,我搞错了,我是想用角色去控制权限,这个代码应该怎么改?不考虑切换用户。 |
-- 作者:有点甜 -- 发布时间:2018/8/1 8:53:00 -- For Each dr As DataRow In DataTables("授权表").Select("用户名 = \'" & User.Group & "\'" )
改成
For Each dr As DataRow In DataTables("授权表").Select("角色 = \'" & User.Roles & "\'" ) |
-- 作者:DLW77 -- 发布时间:2018/8/1 9:07:00 -- 谢谢老师 谢谢老师 |